Package com.mxgraph.sharing
Class mxSharedGraphModel
- java.lang.Object
-
- com.mxgraph.util.mxEventSource
-
- com.mxgraph.sharing.mxSharedState
-
- com.mxgraph.sharing.mxSharedGraphModel
-
public class mxSharedGraphModel extends mxSharedState
Implements a diagram that may be shared among multiple sessions.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.mxgraph.sharing.mxSharedState
mxSharedState.mxDiagramChangeListener
-
Nested classes/interfaces inherited from class com.mxgraph.util.mxEventSource
mxEventSource.mxIEventListener
-
-
Field Summary
Fields Modifier and Type Field Description protected mxCodec
codec
protected mxGraphModel
model
protected boolean
significantRemoteChanges
Whether remote changes should be significant in the local command history.-
Fields inherited from class com.mxgraph.sharing.mxSharedState
delta, diagramChangeListeners, state
-
Fields inherited from class com.mxgraph.util.mxEventSource
eventListeners, eventsEnabled, eventSource
-
-
Constructor Summary
Constructors Constructor Description mxSharedGraphModel(mxGraphModel model)
Constructs a new diagram with the given model.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDelta(java.lang.String edits)
void
cellRemoved(java.lang.Object cell)
Adds removed cells to the codec object lookup for references to the removed cells after this point in time.protected mxUndoableEdit
createUndoableEdit(mxIGraphModel.mxAtomicGraphModelChange[] changes)
Creates a new mxUndoableEdit that implements the notify function to fire a change and notify event via the model.protected mxIGraphModel.mxAtomicGraphModelChange[]
decodeChanges(org.w3c.dom.Node node)
Adds removed cells to the codec object lookup for references to the removed cells after this point in time.mxGraphModel
getModel()
java.lang.String
getState()
Returns the initial state of the diagram.boolean
isSignificantRemoteChanges()
protected java.lang.String
processEdit(org.w3c.dom.Node node)
void
setSignificantRemoteChanges(boolean significantRemoteChanges)
-
Methods inherited from class com.mxgraph.sharing.mxSharedState
addDiagramChangeListener, getDelta, processDelta, removeDiagramChangeListener, resetDelta
-
Methods inherited from class com.mxgraph.util.mxEventSource
addListener, fireEvent, fireEvent, getEventSource, isEventsEnabled, removeListener, removeListener, setEventsEnabled, setEventSource
-
-
-
-
Field Detail
-
model
protected mxGraphModel model
-
codec
protected mxCodec codec
-
significantRemoteChanges
protected boolean significantRemoteChanges
Whether remote changes should be significant in the local command history. Default is true.
-
-
Constructor Detail
-
mxSharedGraphModel
public mxSharedGraphModel(mxGraphModel model)
Constructs a new diagram with the given model.- Parameters:
model
- Initial model of the diagram.
-
-
Method Detail
-
getModel
public mxGraphModel getModel()
- Returns:
- the model
-
isSignificantRemoteChanges
public boolean isSignificantRemoteChanges()
- Returns:
- the significantRemoteChanges
-
setSignificantRemoteChanges
public void setSignificantRemoteChanges(boolean significantRemoteChanges)
- Parameters:
significantRemoteChanges
- the significantRemoteChanges to set
-
getState
public java.lang.String getState()
Returns the initial state of the diagram.- Overrides:
getState
in classmxSharedState
-
addDelta
public void addDelta(java.lang.String edits)
- Overrides:
addDelta
in classmxSharedState
-
processEdit
protected java.lang.String processEdit(org.w3c.dom.Node node)
- Overrides:
processEdit
in classmxSharedState
-
createUndoableEdit
protected mxUndoableEdit createUndoableEdit(mxIGraphModel.mxAtomicGraphModelChange[] changes)
Creates a new mxUndoableEdit that implements the notify function to fire a change and notify event via the model.
-
decodeChanges
protected mxIGraphModel.mxAtomicGraphModelChange[] decodeChanges(org.w3c.dom.Node node)
Adds removed cells to the codec object lookup for references to the removed cells after this point in time.
-
cellRemoved
public void cellRemoved(java.lang.Object cell)
Adds removed cells to the codec object lookup for references to the removed cells after this point in time.
-
-