mxGraph
Public Member Functions | Static Public Attributes | Protected Attributes | Properties | List of all members
com.mxgraph.mxSession Class Reference

Implements a session that may be attached to a shared diagram. More...

Public Member Functions

 mxSession (string id, mxSharedDiagram diagram)
 Constructs a new session with the given ID. More...
 
string Init ()
 Initializes the session buffer and returns a string that represents the state of the session. More...
 
string GetInitialMessage ()
 Returns an XML string that represents the current state of the session and the shared diagram. A globally unique ID is used as the session's namespace, which is used on the client side to prefix IDs of newly created cells. More...
 
void Receive (XmlNode message)
 Posts the change represented by the given XML string to the shared diagram. More...
 
string Poll ()
 Returns the changes received by other sessions for the shared diagram. The method returns an empty XML node if no change was received within 10 seconds. More...
 
string Poll (int timeout)
 Returns the changes received by other sessions for the shared diagram. The method returns an empty XML node if no change was received within the given timeout. More...
 
void DiagramChanged (Object sender, string xml)
 Invoked when the shared diagram has changed. More...
 
long InactiveTimeMillis ()
 Returns the number of milliseconds this session has been inactive. More...
 
void Destroy ()
 Destroys the session and removes its listener from the shared diagram. More...
 

Static Public Attributes

static int DEFAULT_TIMEOUT = 10000
 Default timeout is 10000 ms. More...
 

Protected Attributes

string id
 Holds the session ID. More...
 
mxSharedDiagram diagram
 Reference to the shared diagram. More...
 
StringBuilder buffer = new StringBuilder()
 Holds the send buffer for this session. More...
 
long lastTimeMillis = 0
 Holds the last active time millis. More...
 

Properties

string Id [get]
 Returns the session ID. More...
 

Detailed Description

Implements a session that may be attached to a shared diagram.

Constructor & Destructor Documentation

com.mxgraph.mxSession.mxSession ( string  id,
mxSharedDiagram  diagram 
)
inline

Constructs a new session with the given ID.

Parameters
idSpecifies the session ID to be used.
diagramReference to the shared diagram.

References com.mxgraph.mxDiagramChangeEventHandler().

Member Function Documentation

void com.mxgraph.mxSession.Destroy ( )
inline

Destroys the session and removes its listener from the shared diagram.

References com.mxgraph.mxDiagramChangeEventHandler().

void com.mxgraph.mxSession.DiagramChanged ( Object  sender,
string  xml 
)
inline

Invoked when the shared diagram has changed.

Parameters
senderSession where the change was received from.
xmlXML string that represents the change.
string com.mxgraph.mxSession.GetInitialMessage ( )
inline

Returns an XML string that represents the current state of the session and the shared diagram. A globally unique ID is used as the session's namespace, which is used on the client side to prefix IDs of newly created cells.

long com.mxgraph.mxSession.InactiveTimeMillis ( )
inline

Returns the number of milliseconds this session has been inactive.

string com.mxgraph.mxSession.Init ( )
inline

Initializes the session buffer and returns a string that represents the state of the session.

Returns
Returns the initial state of the session.
string com.mxgraph.mxSession.Poll ( )
inline

Returns the changes received by other sessions for the shared diagram. The method returns an empty XML node if no change was received within 10 seconds.

Returns
Returns a string representing the changes to the shared diagram.
string com.mxgraph.mxSession.Poll ( int  timeout)
inline

Returns the changes received by other sessions for the shared diagram. The method returns an empty XML node if no change was received within the given timeout.

Parameters
timeoutTime in milliseconds to wait for changes.
Returns
Returns a string representing the changes to the shared diagram.
void com.mxgraph.mxSession.Receive ( XmlNode  message)
inline

Posts the change represented by the given XML string to the shared diagram.

Parameters
xmlXML string that represents the change.

Member Data Documentation

StringBuilder com.mxgraph.mxSession.buffer = new StringBuilder()
protected

Holds the send buffer for this session.

int com.mxgraph.mxSession.DEFAULT_TIMEOUT = 10000
static

Default timeout is 10000 ms.

mxSharedDiagram com.mxgraph.mxSession.diagram
protected

Reference to the shared diagram.

string com.mxgraph.mxSession.id
protected

Holds the session ID.

long com.mxgraph.mxSession.lastTimeMillis = 0
protected

Holds the last active time millis.

Property Documentation

string com.mxgraph.mxSession.Id
get

Returns the session ID.


The documentation for this class was generated from the following file: