mxGraph 2.5.0.1


com.mxgraph.sharing
Class mxSharedGraphModel

java.lang.Object
  extended by com.mxgraph.util.mxEventSource
      extended by com.mxgraph.sharing.mxSharedState
          extended by 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
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
mxSharedGraphModel(mxGraphModel model)
          Constructs a new diagram with the given model.
 
Method Summary
 void addDelta(String edits)
           
 void cellRemoved(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(Node node)
          Adds removed cells to the codec object lookup for references to the removed cells after this point in time.
 mxGraphModel getModel()
           
 String getState()
          Returns the initial state of the diagram.
 boolean isSignificantRemoteChanges()
           
protected  String processEdit(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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 String getState()
Returns the initial state of the diagram.

Overrides:
getState in class mxSharedState

addDelta

public void addDelta(String edits)
Overrides:
addDelta in class mxSharedState

processEdit

protected String processEdit(Node node)
Overrides:
processEdit in class mxSharedState

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(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(Object cell)
Adds removed cells to the codec object lookup for references to the removed cells after this point in time.


mxGraph 2.5.0.1


Copyright (c) 2010 Gaudenz Alder, David Benson. All rights reserved.