mxGraph
|
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. | |
string | Init () |
Initializes the session buffer and returns a string that represents the state of the session. | |
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. | |
void | Receive (XmlNode message) |
Posts the change represented by the given XML string to the shared diagram. | |
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. | |
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. | |
void | DiagramChanged (Object sender, string xml) |
Invoked when the shared diagram has changed. | |
long | InactiveTimeMillis () |
Returns the number of milliseconds this session has been inactive. | |
void | Destroy () |
Destroys the session and removes its listener from the shared diagram. | |
Static Public Attributes | |
static int | DEFAULT_TIMEOUT = 10000 |
Default timeout is 10000 ms. | |
Protected Attributes | |
string | id |
Holds the session ID. | |
mxSharedDiagram | diagram |
Reference to the shared diagram. | |
StringBuilder | buffer = new StringBuilder() |
Holds the send buffer for this session. | |
long | lastTimeMillis = 0 |
Holds the last active time millis. | |
Properties | |
string | Id [get] |
Returns the session ID. |
Implements a session that may be attached to a shared diagram.
com.mxgraph.mxSession.mxSession | ( | string | id, |
mxSharedDiagram | diagram | ||
) | [inline] |
Constructs a new session with the given ID.
id | Specifies the session ID to be used. |
diagram | Reference to the shared diagram. |
void com.mxgraph.mxSession.Destroy | ( | ) | [inline] |
Destroys the session and removes its listener from the shared diagram.
void com.mxgraph.mxSession.DiagramChanged | ( | Object | sender, |
string | xml | ||
) | [inline] |
Invoked when the shared diagram has changed.
sender | Session where the change was received from. |
xml | XML 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.
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.
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.
timeout | Time in milliseconds to wait for changes. |
void com.mxgraph.mxSession.Receive | ( | XmlNode | message | ) | [inline] |
Posts the change represented by the given XML string to the shared diagram.
xml | XML string that represents the change. |
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.
string com.mxgraph.mxSession.Id [get] |
Returns the session ID.