maxGraph/docs/js-api/files/util/mxSession-js.html

127 lines
69 KiB
HTML
Raw Normal View History

2012-05-21 20:32:26 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><title>mxSession</title><link rel="stylesheet" type="text/css" href="../../styles/main.css"><script language=JavaScript src="../../javascript/main.js"></script><script language=JavaScript src="../../javascript/prettify.js"></script><script language=JavaScript src="../../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>
<!-- Generated by Natural Docs, version 1.5 -->
<!-- http://www.naturaldocs.org -->
<!-- saved from url=(0026)http://www.naturaldocs.org -->
2012-08-26 10:10:08 +00:00
<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="mxSession"></a>mxSession</h1><div class=CBody><p>Session for sharing an <a href="../model/mxGraphModel-js.html#mxGraphModel" class=LClass id=link50 onMouseOver="ShowTip(event, 'tt1', 'link50')" onMouseOut="HideTip('tt1')">mxGraphModel</a> with other parties via a backend that acts as a multicaster for all changes.</p><h4 class=CHeading>Diagram Sharing</h4><p>The diagram sharing is a mechanism where each atomic change of the model is encoded into XML using <a href="../io/mxCodec-js.html#mxCodec" class=LClass id=link51 onMouseOver="ShowTip(event, 'tt14', 'link51')" onMouseOut="HideTip('tt14')">mxCodec</a> and then transmitted to the server by the <a href="#mxSession.mxSession" class=LFunction id=link52 onMouseOver="ShowTip(event, 'tt8', 'link52')" onMouseOut="HideTip('tt8')">mxSession</a> object.&nbsp; On the server, the XML data is dispatched to each listener on the same diagram (except the sender), and the XML is decoded back into atomic changes on the client side, which are then executed on the model and stored in the command history.</p><p>The <a href="#mxSession.significantRemoteChanges" class=LVariable id=link53 onMouseOver="ShowTip(event, 'tt17', 'link53')" onMouseOut="HideTip('tt17')">mxSession.significantRemoteChanges</a> specifies how these changes are treated with respect to undo: The default value (true) will undo the last change regardless of whether it was a remote or a local change.&nbsp; If the switch is false, then an undo will go back until the last local change, silently undoing all remote changes up to that point.&nbsp; Note that these changes will be added as new remote changes to the history of the other clients.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#mxSession" >mxSession</a></td><td class=SDescription>Session for sharing an <a href="../model/mxGraphModel-js.html#mxGraphModel" class=LClass id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">mxGraphModel</a> with other parties via a backend that acts as a multicaster for all changes.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#mxSession.Events" >Events</a></td><td class=SDescription></td></tr><tr class="SEvent SIndent2 SMarked"><td class=SEntry><a href="#mxSession.mxEvent.CONNECT" >mxEvent.<wbr>CONNECT</a></td><td class=SDescription>Fires after the session has been started, that is, after the response to the initial request was received and the session goes into polling mode. </td></tr><tr class="SEvent SIndent2"><td class=SEntry><a href="#mxSession.mxEvent.SUSPEND" >mxEvent.<wbr>SUSPEND</a></td><td class=SDescription>Fires after <a href="#mxSession.suspend" class=LFunction id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">suspend</a> was called an the session was not already in suspended state. </td></tr><tr class="SEvent SIndent2 SMarked"><td class=SEntry><a href="#mxSession.mxEvent.RESUME" >mxEvent.<wbr>RESUME</a></td><td class=SDescription>Fires after the session was resumed in <a href="#mxSession.resume" class=LFunction id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">resume</a>. </td></tr><tr class="SEvent SIndent2"><td class=SEntry><a href="#mxSession.mxEvent.DISCONNECT" >mxEvent.<wbr>DISCONNECT</a></td><td class=SDescription>Fires after the session was stopped in <a href="#mxSession.stop" class=LFunction id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">stop</a>. </td></tr><tr class="SEvent SIndent2 SMarked"><td class=SEntry><a href="#mxSession.mxEvent.NOTIFY" >mxEvent.<wbr>NOTIFY</a></td><td class=SDescription>Fires after a notification was sent in <a href="#mxSession.notify" class=LFunction id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">notify</a>. </td></tr><tr class="SEvent SIndent2"><td class=SEntry><a href="#mxS
2012-05-21 20:32:26 +00:00
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="mxSession.Events"></a>Events</h3></div></div>
<div class="CEvent"><div class=CTopic><h3 class=CTitle><a name="mxSession.mxEvent.CONNECT"></a>mxEvent.<wbr>CONNECT</h3><div class=CBody><p>Fires after the session has been started, that is, after the response to the initial request was received and the session goes into polling mode.&nbsp; This event has no properties.</p></div></div></div>
2012-08-26 10:10:08 +00:00
<div class="CEvent"><div class=CTopic><h3 class=CTitle><a name="mxSession.mxEvent.SUSPEND"></a>mxEvent.<wbr>SUSPEND</h3><div class=CBody><p>Fires after <a href="#mxSession.suspend" class=LFunction id=link54 onMouseOver="ShowTip(event, 'tt2', 'link54')" onMouseOut="HideTip('tt2')">suspend</a> was called an the session was not already in suspended state.&nbsp; This event has no properties.</p></div></div></div>
2012-05-21 20:32:26 +00:00
2012-08-26 10:10:08 +00:00
<div class="CEvent"><div class=CTopic><h3 class=CTitle><a name="mxSession.mxEvent.RESUME"></a>mxEvent.<wbr>RESUME</h3><div class=CBody><p>Fires after the session was resumed in <a href="#mxSession.resume" class=LFunction id=link55 onMouseOver="ShowTip(event, 'tt3', 'link55')" onMouseOut="HideTip('tt3')">resume</a>.&nbsp; This event has no properties.</p></div></div></div>
2012-05-21 20:32:26 +00:00
2012-08-26 10:10:08 +00:00
<div class="CEvent"><div class=CTopic><h3 class=CTitle><a name="mxSession.mxEvent.DISCONNECT"></a>mxEvent.<wbr>DISCONNECT</h3><div class=CBody><p>Fires after the session was stopped in <a href="#mxSession.stop" class=LFunction id=link56 onMouseOver="ShowTip(event, 'tt4', 'link56')" onMouseOut="HideTip('tt4')">stop</a>.&nbsp; The &lt;code&gt;reason&lt;/code&gt; property contains the optional exception that was passed to the stop method.</p></div></div></div>
2012-05-21 20:32:26 +00:00
2012-08-26 10:10:08 +00:00
<div class="CEvent"><div class=CTopic><h3 class=CTitle><a name="mxSession.mxEvent.NOTIFY"></a>mxEvent.<wbr>NOTIFY</h3><div class=CBody><p>Fires after a notification was sent in <a href="#mxSession.notify" class=LFunction id=link57 onMouseOver="ShowTip(event, 'tt5', 'link57')" onMouseOut="HideTip('tt5')">notify</a>.&nbsp; The &lt;code&gt;url&lt;/code&gt; property contains the URL and the &lt;code&gt;xml&lt;/code&gt; property contains the XML data of the request.</p></div></div></div>
2012-05-21 20:32:26 +00:00
2012-08-26 10:10:08 +00:00
<div class="CEvent"><div class=CTopic><h3 class=CTitle><a name="mxSession.mxEvent.GET"></a>mxEvent.GET</h3><div class=CBody><p>Fires after a response was received in <a href="#mxSession.get" class=LFunction id=link58 onMouseOver="ShowTip(event, 'tt6', 'link58')" onMouseOut="HideTip('tt6')">get</a>.&nbsp; The &lt;code&gt;url&lt;/code&gt; property contains the URL and the &lt;code&gt;request&lt;/code&gt; is the <a href="mxXmlRequest-js.html#mxXmlRequest" class=LClass id=link59 onMouseOver="ShowTip(event, 'tt26', 'link59')" onMouseOut="HideTip('tt26')">mxXmlRequest</a> that contains the response.</p></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CEvent"><div class=CTopic><h3 class=CTitle><a name="mxSession.mxEvent.FIRED"></a>mxEvent.<wbr>FIRED</h3><div class=CBody><p>Fires after an array of edits has been executed on the model.&nbsp; The &lt;code&gt;changes&lt;/code&gt; property contains the array of changes.</p></div></div></div>
2012-08-26 10:10:08 +00:00
<div class="CEvent"><div class=CTopic><h3 class=CTitle><a name="mxSession.mxEvent.RECEIVE"></a>mxEvent.<wbr>RECEIVE</h3><div class=CBody><p>Fires after an XML node was received in <a href="#mxSession.receive" class=LFunction id=link60 onMouseOver="ShowTip(event, 'tt7', 'link60')" onMouseOut="HideTip('tt7')">receive</a>.&nbsp; The &lt;code&gt;node&lt;/code&gt; property contains the node that was received.</p></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="mxSession.Functions"></a>Functions</h3></div></div>
2012-08-26 10:10:08 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxSession.mxSession"></a>mxSession</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function mxSession(</td><td class=PParameter nowrap>model,</td></tr><tr><td></td><td class=PParameter nowrap>urlInit,</td></tr><tr><td></td><td class=PParameter nowrap>urlPoll,</td></tr><tr><td></td><td class=PParameter nowrap>urlNotify</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Constructs a new session using the given <a href="../model/mxGraphModel-js.html#mxGraphModel" class=LClass id=link61 onMouseOver="ShowTip(event, 'tt1', 'link61')" onMouseOut="HideTip('tt1')">mxGraphModel</a> and URLs to communicate with the backend.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>model</td><td class=CDLDescription><a href="../model/mxGraphModel-js.html#mxGraphModel" class=LClass id=link62 onMouseOver="ShowTip(event, 'tt1', 'link62')" onMouseOut="HideTip('tt1')">mxGraphModel</a> that contains the data.</td></tr><tr><td class=CDLEntry>urlInit</td><td class=CDLDescription>URL to be used for initializing the session.</td></tr><tr><td class=CDLEntry>urlPoll</td><td class=CDLDescription>URL to be used for polling the backend.</td></tr><tr><td class=CDLEntry>urlNotify</td><td class=CDLDescription>URL to be used for sending changes to the backend.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="mxSession.Variables"></a>Variables</h3></div></div>
2012-08-26 10:10:08 +00:00
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxSession.model"></a>model</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxSession.prototype.model</td></tr></table></blockquote><p>Reference to the enclosing <a href="../model/mxGraphModel-js.html#mxGraphModel" class=LClass id=link63 onMouseOver="ShowTip(event, 'tt1', 'link63')" onMouseOut="HideTip('tt1')">mxGraphModel</a>.</p></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxSession.urlInit"></a>urlInit</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxSession.prototype.urlInit</td></tr></table></blockquote><p>URL to initialize the session.</p></div></div></div>
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxSession.urlPoll"></a>urlPoll</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxSession.prototype.urlPoll</td></tr></table></blockquote><p>URL for polling the backend.</p></div></div></div>
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxSession.urlNotify"></a>urlNotify</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxSession.prototype.urlNotify</td></tr></table></blockquote><p>URL to send changes to the backend.</p></div></div></div>
2012-08-26 10:10:08 +00:00
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxSession.codec"></a>codec</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxSession.prototype.codec</td></tr></table></blockquote><p>Reference to the <a href="../io/mxCodec-js.html#mxCodec" class=LClass id=link64 onMouseOver="ShowTip(event, 'tt14', 'link64')" onMouseOut="HideTip('tt14')">mxCodec</a> used to encoding and decoding changes.</p></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxSession.linefeed"></a>linefeed</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxSession.prototype.linefeed</td></tr></table></blockquote><p>Used for encoding linefeeds.&nbsp; Default is &lsquo;&amp;#xa;&rsquo;.</p></div></div></div>
2012-08-26 10:10:08 +00:00
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxSession.escapePostData"></a>escapePostData</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxSession.prototype.escapePostData</td></tr></table></blockquote><p>Specifies if the data in the post request sent in <a href="#mxSession.notify" class=LFunction id=link65 onMouseOver="ShowTip(event, 'tt5', 'link65')" onMouseOut="HideTip('tt5')">notify</a> should be converted using encodeURIComponent.&nbsp; Default is true.</p></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxSession.significantRemoteChanges"></a>significantRemoteChanges</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxSession.prototype.significantRemoteChanges</td></tr></table></blockquote><p>Whether remote changes should be significant in the local command history.&nbsp; Default is true.</p></div></div></div>
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxSession.sent"></a>sent</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxSession.prototype.sent</td></tr></table></blockquote><p>Total number of sent bytes.</p></div></div></div>
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxSession.received"></a>received</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxSession.prototype.received</td></tr></table></blockquote><p>Total number of received bytes.</p></div></div></div>
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxSession.debug"></a>debug</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxSession.prototype.debug</td></tr></table></blockquote><p>Specifies if the session should run in debug mode.&nbsp; In this mode, no connection is established.&nbsp; The data is written to the console instead.&nbsp; Default is false.</p></div></div></div>
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxSession.connected"></a>connected</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxSession.prototype.connected</td></tr></table></blockquote></div></div></div>
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxSession.send"></a>send</h3></div></div>
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxSession.polling"></a>polling</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxSession.prototype.polling</td></tr></table></blockquote></div></div></div>
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="mxSession.Functions"></a>Functions</h3></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxSession.start"></a>start</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxSession.prototype.start = function()</td></tr></table></blockquote></div></div></div>
2012-08-26 10:10:08 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxSession.suspend"></a>suspend</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxSession.prototype.suspend = function()</td></tr></table></blockquote><p>Suspends the polling.&nbsp; Use <a href="#mxSession.resume" class=LFunction id=link66 onMouseOver="ShowTip(event, 'tt3', 'link66')" onMouseOut="HideTip('tt3')">resume</a> to reactive the session.&nbsp; Fires a suspend event.</p></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxSession.resume"></a>resume</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxSession.prototype.resume = function(</td><td class=PParameter nowrap>type,</td></tr><tr><td></td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>value</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Resumes the session if it has been suspended.&nbsp; Fires a resume-event before starting the polling.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxSession.stop"></a>stop</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxSession.prototype.stop = function(</td><td class=PParameter nowrap>reason</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Stops the session and fires a disconnect event.&nbsp; The given reason is passed to the disconnect event listener as the second argument.</p></div></div></div>
2012-08-26 10:10:08 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxSession.poll"></a>poll</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxSession.prototype.poll = function()</td></tr></table></blockquote><p>Sends an asynchronous GET request to <a href="#mxSession.urlPoll" class=LVariable id=link67 onMouseOver="ShowTip(event, 'tt11', 'link67')" onMouseOut="HideTip('tt11')">urlPoll</a>.</p></div></div></div>
2012-05-21 20:32:26 +00:00
2012-08-26 10:10:08 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxSession.notify"></a>notify</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxSession.prototype.notify = function(</td><td class=PParameter nowrap>xml,</td></tr><tr><td></td><td class=PParameter nowrap>onLoad,</td></tr><tr><td></td><td class=PParameter nowrap>onError</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sends out the specified XML to <a href="#mxSession.urlNotify" class=LVariable id=link68 onMouseOver="ShowTip(event, 'tt12', 'link68')" onMouseOut="HideTip('tt12')">urlNotify</a> and fires a <a href="#mxSession.notify" class=LFunction id=link69 onMouseOver="ShowTip(event, 'tt5', 'link69')" onMouseOut="HideTip('tt5')">notify</a> event.</p></div></div></div>
2012-05-21 20:32:26 +00:00
2012-08-26 10:10:08 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxSession.get"></a>get</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxSession.prototype.get = function(</td><td class=PParameter nowrap>url,</td></tr><tr><td></td><td class=PParameter nowrap>onLoad,</td></tr><tr><td></td><td class=PParameter nowrap>onError</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sends an asynchronous get request to the given URL, fires a <a href="#mxSession.get" class=LFunction id=link70 onMouseOver="ShowTip(event, 'tt6', 'link70')" onMouseOut="HideTip('tt6')">get</a> event and invokes the given onLoad function when a response is received.</p></div></div></div>
2012-05-21 20:32:26 +00:00
2012-08-26 10:10:08 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxSession.isValidResponse"></a>isValidResponse</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxSession.prototype.isValidResponse = function(</td><td class=PParameter nowrap>req</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns true if the response data in the given <a href="mxXmlRequest-js.html#mxXmlRequest" class=LClass id=link71 onMouseOver="ShowTip(event, 'tt26', 'link71')" onMouseOut="HideTip('tt26')">mxXmlRequest</a> is valid.</p></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxSession.encodeChanges"></a>encodeChanges</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxSession.prototype.encodeChanges = function(</td><td class=PParameter nowrap>changes,</td></tr><tr><td></td><td class=PParameter nowrap>invert</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the XML representation for the given array of changes.</p></div></div></div>
2012-08-26 10:10:08 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxSession.receive"></a>receive</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxSession.prototype.receive = function(</td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Processes the given node by applying the changes to the model.&nbsp; If the nodename is state, then the namespace is used as a prefix for creating Ids in the model, and the child nodes are visited recursively.&nbsp; If the nodename is delta, then the changes encoded in the child nodes are applied to the model.&nbsp; Each call to the receive function fires a <a href="#mxSession.receive" class=LFunction id=link72 onMouseOver="ShowTip(event, 'tt7', 'link72')" onMouseOut="HideTip('tt7')">receive</a> event with the given node as the second argument after processing.&nbsp; If changes are processed, then the function additionally fires a <a href="#mxSession.mxEvent.FIRED" class=LEvent id=link73 onMouseOver="ShowTip(event, 'tt36', 'link73')" onMouseOut="HideTip('tt36')">mxEvent.FIRED</a> event before the <a href="#mxSession.mxEvent.RECEIVE" class=LEvent id=link74 onMouseOver="ShowTip(event, 'tt37', 'link74')" onMouseOut="HideTip('tt37')">mxEvent.RECEIVE</a> event.</p></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxSession.processState"></a>processState</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxSession.prototype.processState = function(</td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Processes the given state node which contains the current state of the remote model.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxSession.processDelta"></a>processDelta</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxSession.prototype.processDelta = function(</td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Processes the given delta node which contains a sequence of edits which in turn map to one transaction on the remote model each.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxSession.processEdit"></a>processEdit</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxSession.prototype.processEdit = function(</td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Processes the given edit by executing its changes and firing the required events via the model.</p></div></div></div>
2012-08-26 10:10:08 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxSession.createUndoableEdit"></a>createUndoableEdit</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxSession.prototype.createUndoableEdit = function(</td><td class=PParameter nowrap>changes</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a new <a href="mxUndoableEdit-js.html#mxUndoableEdit" class=LClass id=link75 onMouseOver="ShowTip(event, 'tt32', 'link75')" onMouseOut="HideTip('tt32')">mxUndoableEdit</a> that implements the notify function to fire a &lt;change&gt; and <a href="#mxSession.notify" class=LFunction id=link76 onMouseOver="ShowTip(event, 'tt5', 'link76')" onMouseOut="HideTip('tt5')">notify</a> event via the model.</p></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxSession.decodeChanges"></a>decodeChanges</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxSession.prototype.decodeChanges = function(</td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Decodes and executes the changes represented by the children in the given node.&nbsp; Returns an array that contains all changes.</p></div></div></div>
2012-08-26 10:10:08 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxSession.decodeChange"></a>decodeChange</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxSession.prototype.decodeChange = function(</td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Decodes, executes and returns the change object represented by the given XML node.</p></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxSession.cellRemoved"></a>cellRemoved</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxSession.prototype.cellRemoved = function(</td><td class=PParameter nowrap>cell,</td></tr><tr><td></td><td class=PParameter nowrap>codec</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds removed cells to the codec object lookup for references to the removed cells after this point in time.</p></div></div></div>
</div><!--Content-->
<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->
2014-10-03 12:49:36 +00:00
<div id=Menu><div class=MEntry><div class=MFile><a href="../index-txt.html">API Specification</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Editor</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MFile><a href="../editor/mxDefaultKeyHandler-js.html">mxDefaultKeyHandler</a></div></div><div class=MEntry><div class=MFile><a href="../editor/mxDefaultPopupMenu-js.html">mxDefaultPopupMenu</a></div></div><div class=MEntry><div class=MFile><a href="../editor/mxDefaultToolbar-js.html">mxDefaultToolbar</a></div></div><div class=MEntry><div class=MFile><a href="../editor/mxEditor-js.html">mxEditor</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent2')">Handler</a><div class=MGroupContent id=MGroupContent2><div class=MEntry><div class=MFile><a href="../handler/mxCellHighlight-js.html">mxCellHighlight</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxCellMarker-js.html">mxCellMarker</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxCellTracker-js.html">mxCellTracker</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxConnectionHandler-js.html">mxConnectionHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxConstraintHandler-js.html">mxConstraintHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxEdgeHandler-js.html">mxEdgeHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxEdgeSegmentHandler-js.html">mxEdgeSegmentHandler.js</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxElbowEdgeHandler-js.html">mxElbowEdgeHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxGraphHandler-js.html">mxGraphHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxKeyHandler-js.html">mxKeyHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxPanningHandler-js.html">mxPanningHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxPopupMenuHandler-js.html">mxPopupMenuHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxRubberband-js.html">mxRubberband</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxSelectionCellsHandler-js.html">mxSelectionCellsHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxTooltipHandler-js.html">mxTooltipHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxHandle-js.html">mxVertexHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxVertexHandler-js.html">mxVertexHandler</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent3')">Io</a><div class=MGroupContent id=MGroupContent3><div class=MEntry><div class=MFile><a href="../io/mxCellCodec-js.html">mxCellCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxChildChangeCodec-js.html">mxChildChangeCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxCodec-js.html">mxCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxCodecRegistry-js.html">mxCodecRegistry</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxDefaultKeyHandlerCodec-js.html">mxDefaultKeyHandlerCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxDefaultPopupMenuCodec-js.html">mxDefaultPopupMenuCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxDefaultToolbarCodec-js.html">mxDefaultToolbarCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxEditorCodec-js.html">mxEditorCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxGenericChangeCodec-js.html">mxGenericChangeCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxGraphCodec-js.html">mxGraphCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxGraphViewCodec-js.html">mxGraphViewCodec<
2012-05-21 20:32:26 +00:00
var searchPanel = new SearchPanel("searchPanel", "HTML", "../../search");
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Cookies">Cookies</option><option value="Events">Events</option><option value="Files">Files</option><option value="Functions">Functions</option><option value="Variables">Variables</option></select></div><script language=JavaScript><!--
HideAllBut([10], 13);// --></script></div><!--Menu-->
<!--START_ND_TOOLTIPS-->
2013-09-19 07:24:45 +00:00
<div class=CToolTip id="tt1"><div class=CClass>Extends mxEventSource to implement a graph model. </div></div><div class=CToolTip id="tt2"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxSession.prototype.suspend = function()</td></tr></table></blockquote>Suspends the polling. </div></div><div class=CToolTip id="tt3"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxSession.prototype.resume = function(</td><td class=PParameter nowrap>type,</td></tr><tr><td></td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>value</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Resumes the session if it has been suspended. </div></div><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxSession.prototype.stop = function(</td><td class=PParameter nowrap>reason</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Stops the session and fires a disconnect event. </div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxSession.prototype.notify = function(</td><td class=PParameter nowrap>xml,</td></tr><tr><td></td><td class=PParameter nowrap>onLoad,</td></tr><tr><td></td><td class=PParameter nowrap>onError</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sends out the specified XML to urlNotify and fires a notify event.</div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxSession.prototype.get = function(</td><td class=PParameter nowrap>url,</td></tr><tr><td></td><td class=PParameter nowrap>onLoad,</td></tr><tr><td></td><td class=PParameter nowrap>onError</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sends an asynchronous get request to the given URL, fires a get event and invokes the given onLoad function when a response is received.</div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxSession.prototype.receive = function(</td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Processes the given node by applying the changes to the model. </div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function mxSession(</td><td class=PParameter nowrap>model,</td></tr><tr><td></td><td class=PParameter nowrap>urlInit,</td></tr><tr><td></td><td class=PParameter nowrap>urlPoll,</td></tr><tr><td></td><td class=PParameter nowrap>urlNotify</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Constructs a new session using the given mxGraphModel and URLs to communicate with the backend.</div></div><div class=CToolTip id="tt9"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxSession.prototype.model</td></tr></table></blockquote>Reference to the enclosing mxGraphModel.</div></div><div class=CToolTip id="tt10"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 cl
2012-05-21 20:32:26 +00:00
<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>
<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>