UNPKG

gojs

Version:

Interactive diagrams, charts, and graphs, such as trees, flowcharts, orgcharts, UML, BPMN, or business diagrams

784 lines (783 loc) 48 kB
<!doctype html> <html class="default no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>ChangedEvent | GoJS API</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="../../assets/css/bootstrap.min.css"> <link rel="stylesheet" href="../assets/css/main.css"> </head> <body> <header> <!-- non-fixed navbar --> <nav id="non-fixed-nav" class="navbar navbar-inverse navbar-top"> <div class="container-fluid"> <div class="navbar-header"> <div class="navheader-container"> <div class="navheader-collapse" data-toggle="collapse" data-target="#navbar"> <a id="toplogo" class="navbar-brand" href="../../index.html">GoJS</a> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> </div> </div> <div id="navbar" class="navbar-collapse collapse"> <ul class="nav navbar-nav navbar-right"> <li><a href="../../index.html">Home</a></li> <li><a href="../../learn/index.html">Learn</a></li> <li><a href="../../samples/index.html">Samples</a></li> <li><a href="../../intro/index.html">Intro</a></li> <li><a href="../../api/index.html" target="api">API</a></li> <li><a href="https://www.nwoods.com/components/evalform.htm">Register</a></li> <li><a href="../../download.html">Download</a></li> <li><a href="https://forum.nwoods.com/c/gojs">Forum</a></li> <li><a href="https://www.nwoods.com/contact.html" onclick="ga('send','event','Outbound Link','click','contact');">Contact</a></li> <li class="buy"><a href="https://www.nwoods.com/sales/index.html" onclick="ga('send','event','Outbound Link','click','buy');">Buy</a></li> <li class="activate"><a href="https://www.nwoods.com/app/activate.aspx?sku=gojs">Activate</a></li> </ul> </div><!--/.nav-collapse --> </div> </nav> <div class="tsd-page-header"> <div class="tsd-page-toolbar"> <div class="container-fluid plr15"> <div class="table-wrap"> <div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base=".."> <div class="field"> <label for="tsd-search-field" class="tsd-widget search no-caption">Search</label> <input id="tsd-search-field" type="text" /> </div> <ul class="results"> <li class="state loading">Preparing search index...</li> <li class="state failure">The search index is not available</li> </ul> <a href="../index.html" class="title">GoJS API</a> </div> <div class="table-cell" id="tsd-widgets"> <div id="tsd-filter"> <a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a> <div class="tsd-filter-group"> <div class="tsd-select" id="tsd-filter-visibility"> <span class="tsd-select-label">All</span> <ul class="tsd-select-list"> <li data-value="public">Public</li> <li data-value="protected">Public/Protected</li> <li data-value="private" class="selected">All</li> </ul> </div> </div> </div> <a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a> </div> </div> </div> </div> <div class="tsd-page-title"> <div class="container-fluid plr15"> <div class="top-copyright"> <!--<b>GoJS</b>&reg; Diagramming Components<br/>version &lt;br/&gt;version 2.1.18 for TypeScript/HTML<br/>by <a href="https://www.nwoods.com/">Northwoods Software&reg;</a>--> <b>GoJS</b>&reg; Diagramming Components<br/>version 2.1.18<br/>by <a href="https://www.nwoods.com/">Northwoods Software&reg;</a> </div> <div> <h1>Class ChangedEvent</h1> </div> </div> </div> </div> </header> <div class="container-fluid container-main plr15"> <div class="row"> <div class="col-8 col-content"> <section class="tsd-panel tsd-hierarchy"> <h3>Hierarchy</h3> <ul class="tsd-hierarchy"> <li> <span class="target">ChangedEvent</span> </li> </ul> </section> <section class="tsd-panel tsd-comment"> <div class="tsd-comment tsd-typography"> <p>A ChangedEvent represents a change to an object, typically a <a href="GraphObject.html">GraphObject</a>, but also for model data, a <a href="Model.html">Model</a>, or a <a href="Diagram.html">Diagram</a>. The most common case is for remembering the name of a property and the before-and-after values for that property.</p> <p>You can listen for changed events on the model using <a href="Model.html#addChangedListener">Model.addChangedListener</a> or <a href="Diagram.html#addModelChangedListener">Diagram.addModelChangedListener</a>, and on the Diagram using <a href="Diagram.html#addChangedListener">Diagram.addChangedListener</a>.</p> <p>There are four kinds of changes, represented by enumerated values: <a href="ChangedEvent.html#static-Property">ChangedEvent.Property</a> (the most common), <a href="ChangedEvent.html#static-Insert">ChangedEvent.Insert</a> and <a href="ChangedEvent.html#static-Remove">ChangedEvent.Remove</a> (to represent inserting or removing objects from collections), and <a href="ChangedEvent.html#static-Transaction">ChangedEvent.Transaction</a> (to notify about beginning or ending transactions or undo or redo).</p> <p>The most common kind of ChangedEvent is a Property change. The name of the property is given by <a href="ChangedEvent.html#propertyName">propertyName</a>. The modified object is given by <a href="ChangedEvent.html#object">object</a>. Use the <a href="ChangedEvent.html#oldValue">oldValue</a> and <a href="ChangedEvent.html#newValue">newValue</a> properties for the before and after property values.</p> <p>For an Insert ChangedEvent, the modified collection (often an Array) is a property value on the <a href="ChangedEvent.html#object">object</a>. The <a href="ChangedEvent.html#propertyName">propertyName</a> helps distinguish between different collections on the object. Use the <a href="ChangedEvent.html#newValue">newValue</a> property to indicate the value that was inserted. Use the <a href="ChangedEvent.html#newParam">newParam</a> property to indicate where or how, such as an array index or dictionary key.</p> <p>For a Remove ChangedEvent, the modified collection is a property value on the <a href="ChangedEvent.html#object">object</a>. The <a href="ChangedEvent.html#propertyName">propertyName</a> helps distinguish between different collections on the object. Use the <a href="ChangedEvent.html#oldValue">oldValue</a> property to indicate the value that was removed. Use the <a href="ChangedEvent.html#oldParam">oldParam</a> property to indicate where or how, such as an array index or dictionary key.</p> <p>Transaction ChangedEvents are generated by the <a href="UndoManager.html">UndoManager</a>. The <a href="ChangedEvent.html#propertyName">propertyName</a> names the nature of the ChangedEvent. For the very first transaction, the property name is &quot;StartingFirstTransaction&quot;. This ChangedEvent precedes a ChangedEvent whose property name is &quot;StartedTransaction&quot;, which occurs for every top-level transaction.</p> <p>When ending a transaction, there is first a ChangedEvent whose name is &quot;ComittingTransaction&quot;. This is followed by one with either &quot;CommittedTransaction&quot; or &quot;RolledBackTransaction&quot;, depending on how the transaction is ending. The <a href="ChangedEvent.html#oldValue">oldValue</a> provides the transaction name and the <a href="ChangedEvent.html#object">object</a> is the <a href="Transaction.html">Transaction</a> being finished. (Note that the Transaction value may be null if no Transaction is available at that time, perhaps because there were no changes made during the transaction.) That Transaction can be scanned to look for ChangedEvents that you may wish to record in a database, all within a single database transaction.</p> <p>There are also Transaction ChangedEvents corresponding to &quot;StartingUndo&quot;, &quot;FinishedUndo&quot;, &quot;StartingRedo&quot;, and &quot;FinishedRedo&quot;. The <a href="ChangedEvent.html#object">object</a> property provides the <a href="Transaction.html">Transaction</a> that is about-to-be or just-was undone or redone.</p> <p>Non-Transaction ChangedEvents are remembered by the <a href="UndoManager.html">UndoManager</a>, if <a href="UndoManager.html#isEnabled">UndoManager.isEnabled</a>, and held in the <a href="UndoManager.html#history">UndoManager.history</a> as <a href="Transaction.html">Transaction</a>s which hold lists of ChangedEvents. That is why ChangedEvent implements <a href="ChangedEvent.html#undo">undo</a> and <a href="ChangedEvent.html#redo">redo</a> of the change that it remembers.</p> <p>When the ChangedEvent represents a change to a <a href="Model.html">Model</a>, the value of <a href="ChangedEvent.html#model">model</a> is non-null and the value of <a href="ChangedEvent.html#diagram">diagram</a> is meaningless. If the change is a structural change to the model, the value of <a href="ChangedEvent.html#modelChange">modelChange</a> indicates the kind of change. Currently defined model changed event names include:</p> <ul> <li><strong>&quot;nodeDataArray&quot;</strong>, after the model&#39;s <a href="Model.html#nodeDataArray">Model.nodeDataArray</a> is replaced, inserted into or removed from (setting <a href="Model.html#nodeDataArray">Model.nodeDataArray</a> or calling <a href="Model.html#addNodeData">Model.addNodeData</a> or <a href="Model.html#removeNodeData">Model.removeNodeData</a>)</li> <li><strong>&quot;nodeKey&quot;</strong>, after changing a node data&#39;s unique key (<a href="Model.html#setKeyForNodeData">Model.setKeyForNodeData</a>)</li> <li><strong>&quot;nodeCategory&quot;</strong>, after changing a node data&#39;s category (<a href="Model.html#setCategoryForNodeData">Model.setCategoryForNodeData</a>)</li> <li><strong>&quot;linkDataArray&quot;</strong>, after the model&#39;s <a href="GraphLinksModel.html#linkDataArray">GraphLinksModel.linkDataArray</a> is replaced, inserted into or removed from (setting <a href="GraphLinksModel.html#linkDataArray">GraphLinksModel.linkDataArray</a> or calling <a href="GraphLinksModel.html#addLinkData">GraphLinksModel.addLinkData</a> or <a href="GraphLinksModel.html#removeLinkData">GraphLinksModel.removeLinkData</a>)</li> <li><strong>&quot;linkKey&quot;</strong>, after changing a link data&#39;s unique key (<a href="GraphLinksModel.html#setKeyForLinkData">GraphLinksModel.setKeyForLinkData</a>)</li> <li><strong>&quot;linkCategory&quot;</strong>, after changing a link data&#39;s category (<a href="GraphLinksModel.html#setCategoryForLinkData">GraphLinksModel.setCategoryForLinkData</a>)</li> <li><strong>&quot;linkFromKey&quot;</strong>, after changing a link data&#39;s &quot;from&quot; node key (<a href="GraphLinksModel.html#setFromKeyForLinkData">GraphLinksModel.setFromKeyForLinkData</a>)</li> <li><strong>&quot;linkToKey&quot;</strong>, after changing a link data&#39;s &quot;to&quot; node key (<a href="GraphLinksModel.html#setToKeyForLinkData">GraphLinksModel.setToKeyForLinkData</a>)</li> <li><strong>&quot;linkFromPortId&quot;</strong>, after changing a link data&#39;s &quot;from&quot; port identifier string (<a href="GraphLinksModel.html#setFromPortIdForLinkData">GraphLinksModel.setFromPortIdForLinkData</a>)</li> <li><strong>&quot;linkToPortId&quot;</strong>, after changing a link data&#39;s &quot;to&quot; port identifier string (<a href="GraphLinksModel.html#setToPortIdForLinkData">GraphLinksModel.setToPortIdForLinkData</a>)</li> <li><strong>&quot;linkLabelKeys&quot;</strong>, after replacing, inserting into, or removing from a link data&#39;s array of keys to label nodes (calling <a href="GraphLinksModel.html#setLabelKeysForLinkData">GraphLinksModel.setLabelKeysForLinkData</a>, <a href="GraphLinksModel.html#addLabelKeyForLinkData">GraphLinksModel.addLabelKeyForLinkData</a>, or <a href="GraphLinksModel.html#removeLabelKeyForLinkData">GraphLinksModel.removeLabelKeyForLinkData</a>)</li> <li><strong>&quot;nodeGroupKey&quot;</strong>, after changing a node data&#39;s key for a containing group data (<a href="GraphLinksModel.html#setGroupKeyForNodeData">GraphLinksModel.setGroupKeyForNodeData</a>)</li> <li><strong>&quot;nodeParentKey&quot;</strong>, after changing a node data&#39;s &quot;parent&quot; node key (<a href="TreeModel.html#setParentKeyForNodeData">TreeModel.setParentKeyForNodeData</a>)</li> <li><strong>&quot;parentLinkCategory&quot;</strong>, after changing a node data&#39;s &quot;parent&quot; link&#39;s category(<a href="TreeModel.html#setParentLinkCategoryForNodeData">TreeModel.setParentLinkCategoryForNodeData</a>)</li> <li>other names are for internal implementation use only, only on Transaction ChangedEvents</li> </ul> <p>The value of <a href="ChangedEvent.html#propertyName">ChangedEvent.propertyName</a> indicates the actual name of the property that was modified. <a href="ChangedEvent.html#modelChange">ChangedEvent.modelChange</a> is a non-empty string only when there is a known structural change to the model, not just the setting of some property on some object.</p> <p>When the ChangedEvent represents a change to a <a href="Diagram.html">Diagram</a> or a <a href="GraphObject.html">GraphObject</a> within a diagram, the value of <a href="ChangedEvent.html#diagram">diagram</a> is non-null and the values of <a href="ChangedEvent.html#model">model</a> and <a href="ChangedEvent.html#modelChange">modelChange</a> are meaningless.</p> <p>Please note that ChangedEvents can be raised for many different causes. You may not be interested in changes to temporary objects -- in that case ignore the ChangedEvent when <a href="Model.html#skipsUndoManager">Model.skipsUndoManager</a> or <a href="Diagram.html#skipsUndoManager">Diagram.skipsUndoManager</a> is true.</p> </div> </section> <section class="tsd-panel-group tsd-index-group"> <h2>Index</h2> <section class="tsd-panel tsd-index-panel"> <div class="tsd-index-content"> <section class="tsd-index-section "> <h3>Constructors</h3> <ul class="tsd-index-list"> <li class="tsd-kind-constructor tsd-parent-kind-class"><a href="ChangedEvent.html#constructor" class="tsd-kind-icon">constructor</a></li> </ul> </section> <section class="tsd-index-section "> <h3>Properties</h3> <ul class="tsd-index-list"> <li class="tsd-kind-accessor tsd-parent-kind-class"><a href="ChangedEvent.html#change" class="tsd-kind-icon">change</a></li> <li class="tsd-kind-accessor tsd-parent-kind-class"><a href="ChangedEvent.html#diagram" class="tsd-kind-icon">diagram</a></li> <li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="ChangedEvent.html#isTransactionFinished" class="tsd-kind-icon">is<wbr>Transaction<wbr>Finished</a></li> <li class="tsd-kind-accessor tsd-parent-kind-class"><a href="ChangedEvent.html#model" class="tsd-kind-icon">model</a></li> <li class="tsd-kind-accessor tsd-parent-kind-class"><a href="ChangedEvent.html#modelChange" class="tsd-kind-icon">model<wbr>Change</a></li> <li class="tsd-kind-accessor tsd-parent-kind-class"><a href="ChangedEvent.html#newParam" class="tsd-kind-icon">new<wbr>Param</a></li> <li class="tsd-kind-accessor tsd-parent-kind-class"><a href="ChangedEvent.html#newValue" class="tsd-kind-icon">new<wbr>Value</a></li> <li class="tsd-kind-accessor tsd-parent-kind-class"><a href="ChangedEvent.html#object" class="tsd-kind-icon">object</a></li> <li class="tsd-kind-accessor tsd-parent-kind-class"><a href="ChangedEvent.html#oldParam" class="tsd-kind-icon">old<wbr>Param</a></li> <li class="tsd-kind-accessor tsd-parent-kind-class"><a href="ChangedEvent.html#oldValue" class="tsd-kind-icon">old<wbr>Value</a></li> <li class="tsd-kind-accessor tsd-parent-kind-class"><a href="ChangedEvent.html#propertyName" class="tsd-kind-icon">property<wbr>Name</a></li> </ul> </section> <section class="tsd-index-section "> <h3>Methods</h3> <ul class="tsd-index-list"> <li class="tsd-kind-method tsd-parent-kind-class"><a href="ChangedEvent.html#canRedo" class="tsd-kind-icon">can<wbr>Redo</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="ChangedEvent.html#canUndo" class="tsd-kind-icon">can<wbr>Undo</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="ChangedEvent.html#clear" class="tsd-kind-icon">clear</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="ChangedEvent.html#copy" class="tsd-kind-icon">copy</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="ChangedEvent.html#getParam" class="tsd-kind-icon">get<wbr>Param</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="ChangedEvent.html#getValue" class="tsd-kind-icon">get<wbr>Value</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="ChangedEvent.html#redo" class="tsd-kind-icon">redo</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="ChangedEvent.html#undo" class="tsd-kind-icon">undo</a></li> </ul> </section> <section class="tsd-index-section "> <h3>Constants</h3> <ul class="tsd-index-list"> <li class="tsd-kind-constant tsd-parent-kind-class tsd-is-static"><a href="ChangedEvent.html#static-Insert" class="tsd-kind-icon">Insert</a></li> <li class="tsd-kind-constant tsd-parent-kind-class tsd-is-static"><a href="ChangedEvent.html#static-Property" class="tsd-kind-icon">Property</a></li> <li class="tsd-kind-constant tsd-parent-kind-class tsd-is-static"><a href="ChangedEvent.html#static-Remove" class="tsd-kind-icon">Remove</a></li> <li class="tsd-kind-constant tsd-parent-kind-class tsd-is-static"><a href="ChangedEvent.html#static-Transaction" class="tsd-kind-icon">Transaction</a></li> </ul> </section> </div> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Constructors</h2> <section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class"> <a name="constructor" class="tsd-anchor"></a> <h3> constructor </h3> <ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">new <wbr>Changed<wbr>Event<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ChangedEvent.html" class="tsd-signature-type">ChangedEvent</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <div class="tsd-comment tsd-typography"> <p>The ChangedEvent class constructor produces an empty ChangedEvent object.</p> </div> <h4 class="tsd-returns-title">Returns <a href="ChangedEvent.html" class="tsd-signature-type">ChangedEvent</a></h4> </li> </ul> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Properties</h2> <section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class"> <a name="change" class="tsd-anchor"></a> <h3> change <span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">EnumValue</span> </h3> <ul class="tsd-descriptions"> <li class="tsd-description"> <div class="tsd-comment tsd-typography"> <p>Gets or sets the nature of change that occurred. The default is <a href="ChangedEvent.html#static-Property">ChangedEvent.Property</a>. Other values are <a href="ChangedEvent.html#static-Insert">ChangedEvent.Insert</a>, <a href="ChangedEvent.html#static-Remove">ChangedEvent.Remove</a>, and <a href="ChangedEvent.html#static-Transaction">ChangedEvent.Transaction</a>.</p> </div> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class"> <a name="diagram" class="tsd-anchor"></a> <h3> diagram <span class="tsd-signature-symbol">: </span><a href="Diagram.html" class="tsd-signature-type">Diagram</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span> </h3> <ul class="tsd-descriptions"> <li class="tsd-description"> <div class="tsd-comment tsd-typography"> <p>Gets or sets the <a href="Diagram.html">Diagram</a> that was modified. When this property is non-null, the <a href="ChangedEvent.html#model">model</a> property will be null. However this property and the <a href="ChangedEvent.html#model">model</a> property may both be null simultaneously, when no particular model or diagram applies.</p> </div> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class"> <a name="isTransactionFinished" class="tsd-anchor"></a> <h3> <span class="tsd-flag ts-flagReadOnly">Read-only</span> is<wbr>Transaction<wbr>Finished <span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span> </h3> <ul class="tsd-descriptions"> <li class="tsd-description"> <div class="tsd-comment tsd-typography"> <p>This read-only property is true when this ChangedEvent is of type <a href="ChangedEvent.html#static-Transaction">ChangedEvent.Transaction</a> and represents the end of a transactional change. It is implemented as:</p> <pre><code class="hljs js"><span class="hljs-keyword">return</span> (<span class="hljs-keyword">this</span>.change === ChangedEvent.Transaction &amp;&amp; (<span class="hljs-keyword">this</span>.propertyName === <span class="hljs-string">"CommittedTransaction"</span> || <span class="hljs-keyword">this</span>.propertyName === <span class="hljs-string">"FinishedUndo"</span> || <span class="hljs-keyword">this</span>.propertyName === <span class="hljs-string">"FinishedRedo"</span>));</code></pre> </div> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class"> <a name="model" class="tsd-anchor"></a> <h3> model <span class="tsd-signature-symbol">: </span><a href="Model.html" class="tsd-signature-type">Model</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span> </h3> <ul class="tsd-descriptions"> <li class="tsd-description"> <div class="tsd-comment tsd-typography"> <p>Gets or sets the <a href="Model.html">Model</a> or <a href="TreeModel.html">TreeModel</a> or <a href="GraphLinksModel.html">GraphLinksModel</a> that was modified. When this property is non-null, the <a href="ChangedEvent.html#diagram">diagram</a> property will be null. However this property and the <a href="ChangedEvent.html#diagram">diagram</a> property may both be null simultaneously, when no particular model or diagram applies.</p> </div> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class"> <a name="modelChange" class="tsd-anchor"></a> <h3> model<wbr>Change <span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span> </h3> <ul class="tsd-descriptions"> <li class="tsd-description"> <div class="tsd-comment tsd-typography"> <p>Gets or sets the name of the model change, reflecting a change to model data in addition to a change to the model itself.</p> <p>The default is an empty string, which indicates that this is just a regular change to some object&#39;s state, probably its property. For a list of possible model change names, see the documentation for <a href="ChangedEvent.html">ChangedEvent</a>. The names are compared in a case-sensitive manner.</p> </div> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class"> <a name="newParam" class="tsd-anchor"></a> <h3> new<wbr>Param <span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span> </h3> <ul class="tsd-descriptions"> <li class="tsd-description"> <div class="tsd-comment tsd-typography"> <p>Gets or sets an optional value associated with the new value. Most properties do not require any parameter to describe the change. This is typically a value that helps distinguish the new value, such as an index into an array. It is null if it is not used. The default is null.</p> </div> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class"> <a name="newValue" class="tsd-anchor"></a> <h3> new<wbr>Value <span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span> </h3> <ul class="tsd-descriptions"> <li class="tsd-description"> <div class="tsd-comment tsd-typography"> <p>Gets or sets the next or current value that the property has. The default is null.</p> </div> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class"> <a name="object" class="tsd-anchor"></a> <h3> object <span class="tsd-signature-symbol">: </span><a href="ObjectData.html" class="tsd-signature-type">ObjectData</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span> </h3> <ul class="tsd-descriptions"> <li class="tsd-description"> <div class="tsd-comment tsd-typography"> <p>Gets or sets the Object that was modified. The default is null.</p> <p>For <a href="ChangedEvent.html#static-Transaction">ChangedEvent.Transaction</a> changes, this may be the <a href="Transaction.html">Transaction</a>.</p> </div> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class"> <a name="oldParam" class="tsd-anchor"></a> <h3> old<wbr>Param <span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span> </h3> <ul class="tsd-descriptions"> <li class="tsd-description"> <div class="tsd-comment tsd-typography"> <p>Gets or sets an optional value associated with the old value. Most properties do not require any parameter to describe the change. This is typically a value that helps distinguish the old value, such as an index into an array. It is null if it is not used. The default is null.</p> </div> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class"> <a name="oldValue" class="tsd-anchor"></a> <h3> old<wbr>Value <span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span> </h3> <ul class="tsd-descriptions"> <li class="tsd-description"> <div class="tsd-comment tsd-typography"> <p>Gets or sets the previous or old value that the property had. The default is null.</p> </div> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class"> <a name="propertyName" class="tsd-anchor"></a> <h3> property<wbr>Name <span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">a</span><span class="tsd-signature-symbol">: </span><a href="ObjectData.html" class="tsd-signature-type">ObjectData</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">b</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span> </h3> <ul class="tsd-descriptions"> <li class="tsd-description"> <div class="tsd-comment tsd-typography"> <p>Gets or sets the name of the property change. The default is an empty string, which is not a valid property name. This property can be useful even when the type of change is not <a href="ChangedEvent.html#static-Property">ChangedEvent.Property</a>, because it can help identify the collection in the <a href="ChangedEvent.html#object">object</a> that was modified (for <a href="ChangedEvent.html#static-Insert">ChangedEvent.Insert</a> or <a href="ChangedEvent.html#static-Remove">ChangedEvent.Remove</a>) or the stage of the current transaction (for <a href="ChangedEvent.html#static-Transaction">ChangedEvent.Transaction</a>).</p> </div> </li> </ul> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Methods</h2> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="canRedo" class="tsd-anchor"></a> <h3> can<wbr>Redo </h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">can<wbr>Redo<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <div class="tsd-comment tsd-typography"> <p>This predicate returns true if you can call redo().</p> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4> <p>True if ready for redo() to be called.</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="canUndo" class="tsd-anchor"></a> <h3> can<wbr>Undo </h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">can<wbr>Undo<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <div class="tsd-comment tsd-typography"> <p>This predicate returns true if you can call undo().</p> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4> <p>True if ready for undo() to be called.</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="clear" class="tsd-anchor"></a> <h3> clear </h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">clear<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <div class="tsd-comment tsd-typography"> <p>Forget any object references that this ChangedEvent may have.</p> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="copy" class="tsd-anchor"></a> <h3> copy </h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">copy<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="ChangedEvent.html" class="tsd-signature-type">ChangedEvent</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <div class="tsd-comment tsd-typography"> <p>Make a copy of this ChangedEvent. ChangedEvents are copied when the <a href="UndoManager.html">UndoManager</a> adds to a <a href="Transaction.html">Transaction</a>.</p> </div> <h4 class="tsd-returns-title">Returns <a href="ChangedEvent.html" class="tsd-signature-type">ChangedEvent</a></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="getParam" class="tsd-anchor"></a> <h3> get<wbr>Param </h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">get<wbr>Param<span class="tsd-signature-symbol">(</span>undo<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <div class="tsd-comment tsd-typography"> <p>This is a convenient method to get the right parameter value, depending on the value of undo, when implementing a state change as part of an undo or a redo.</p> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>undo: <span class="tsd-signature-type">boolean</span></h5> <div class="tsd-comment tsd-typography"> <p>If true, returns the oldParam, otherwise returns the newParam.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4> <p>Either the oldParam or the newParam.</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="getValue" class="tsd-anchor"></a> <h3> get<wbr>Value </h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">get<wbr>Value<span class="tsd-signature-symbol">(</span>undo<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <div class="tsd-comment tsd-typography"> <p>This is a convenient method to get the right value, depending on the value of undo, when implementing a state change as part of an undo or a redo.</p> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>undo: <span class="tsd-signature-type">boolean</span></h5> <div class="tsd-comment tsd-typography"> <p>If true, returns the oldValue, otherwise returns the newValue.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4> <p>Either the oldValue or the newValue.</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="redo" class="tsd-anchor"></a> <h3> redo </h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">redo<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <div class="tsd-comment tsd-typography"> <p>Re-perform this object change after an undo(). canRedo() must be true for this method to have any effect.</p> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="undo" class="tsd-anchor"></a> <h3> undo </h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">undo<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <div class="tsd-comment tsd-typography"> <p>Reverse the effects of this object change. canUndo() must be true for this method to have any effect.</p> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Constants</h2> <section class="tsd-panel tsd-member tsd-kind-constant tsd-parent-kind-class tsd-is-static"> <a name="static-Insert" class="tsd-anchor"></a> <h3> <span class="tsd-flag ts-flagStatic">Static</span> Insert <span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">EnumValue</span> </h3> <div class="tsd-comment tsd-typography"> <p>For inserting into collections, and used as the value for <a href="ChangedEvent.html#change">ChangedEvent.change</a>. The modified object is given by <a href="ChangedEvent.html#object">ChangedEvent.object</a>. Use the optional <a href="ChangedEvent.html#propertyName">ChangedEvent.propertyName</a> to distinguish between different collections on the object. Use the <a href="ChangedEvent.html#newValue">ChangedEvent.newValue</a> property to indicate the value that was inserted. Use the optional <a href="ChangedEvent.html#newParam">ChangedEvent.newParam</a> property to indicate where or how, such as an array index or dictionary key.</p> </div> </section> <section class="tsd-panel tsd-member tsd-kind-constant tsd-parent-kind-class tsd-is-static"> <a name="static-Property" class="tsd-anchor"></a> <h3> <span class="tsd-flag ts-flagStatic">Static</span> Property <span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">EnumValue</span> </h3> <div class="tsd-comment tsd-typography"> <p>For simple property changes, and used as the value for <a href="ChangedEvent.html#change">ChangedEvent.change</a>. The name of the property is given by <a href="ChangedEvent.html#propertyName">ChangedEvent.propertyName</a>. The modified object is given by <a href="ChangedEvent.html#object">ChangedEvent.object</a>. Use the <a href="ChangedEvent.html#oldValue">ChangedEvent.oldValue</a> and <a href="ChangedEvent.html#newValue">ChangedEvent.newValue</a> properties for the previous and next property values.</p> <p>For model changes, the <a href="ChangedEvent.html#modelChange">ChangedEvent.modelChange</a> may be non-empty, indicating a structural change to the model.</p> </div> </section> <section class="tsd-panel tsd-member tsd-kind-constant tsd-parent-kind-class tsd-is-static"> <a name="static-Remove" class="tsd-anchor"></a> <h3> <span class="tsd-flag ts-flagStatic">Static</span> Remove <span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">EnumValue</span> </h3> <div class="tsd-comment tsd-typography"> <p>For removing from collections, and used as the value for <a href="ChangedEvent.html#change">ChangedEvent.change</a>. The modified object is given by <a href="ChangedEvent.html#object">ChangedEvent.object</a>. Use the optional <a href="ChangedEvent.html#propertyName">ChangedEvent.propertyName</a> to distinguish between different collections on the object. Use the <a href="ChangedEvent.html#oldValue">ChangedEvent.oldValue</a> property to indicate the value that was removed. Use the optional <a href="ChangedEvent.html#oldParam">ChangedEvent.oldParam</a> property to indicate where or how, such as an array index or dictionary key.</p> </div> </section> <section class="tsd-panel tsd-member tsd-kind-constant tsd-parent-kind-class tsd-is-static"> <a name="static-Transaction" class="tsd-anchor"></a> <h3> <span class="tsd-flag ts-flagStatic">Static</span> Transaction <span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">EnumValue</span> </h3> <div class="tsd-comment tsd-typography"> <p>For informational events, such as transactions and undo/redo operations, and used as the value for <a href="ChangedEvent.html#change">ChangedEvent.change</a>. The <a href="ChangedEvent.html#object">ChangedEvent.object</a> refers to the <a href="Transaction.html">Transaction</a> affected, if any. The <a href="ChangedEvent.html#propertyName">ChangedEvent.propertyName</a> distinguishes the different transaction or undo or redo stages. The <a href="ChangedEvent.html#oldValue">ChangedEvent.oldValue</a> may provide the transaction name, if available, as given to <a href="UndoManager.html#commitTransaction">UndoManager.commitTransaction</a>.</p> </div> </section> </section> </div> <div class="col-4 col-menu menu-sticky-wrap menu-highlight"> <nav class="tsd-navigation primary"> <ul> <li class="globals "> <a href="../index.html"><em>GoJS <wbr>Class <wbr>Index</em></a> </li> </ul> </nav> <nav class="tsd-navigation secondary menu-sticky"> <ul class="before-current"> </ul> <ul class="current"> <li class="current tsd-kind-class"> <a href="ChangedEvent.html" class="tsd-kind-icon">Changed<wbr>Event</a> <ul> <li class=" tsd-kind-constructor tsd-parent-kind-class"> <a href="ChangedEvent.html#constructor" class="tsd-kind-icon">constructor</a> </li> <li class=" tsd-kind-accessor tsd-parent-kind-class"> <a href="ChangedEvent.html#change" class="tsd-kind-icon">change</a> </li> <li class=" tsd-kind-accessor tsd-parent-kind-class"> <a href="ChangedEvent.html#diagram" class="tsd-kind-icon">diagram</a> </li> <li class=" tsd-kind-get-signature tsd-parent-kind-class"> <a href="ChangedEvent.html#isTransactionFinished" class="tsd-kind-icon">is<wbr>Transaction<wbr>Finished</a> </li> <li class=" tsd-kind-accessor tsd-parent-kind-class"> <a href="ChangedEvent.html#model" class="tsd-kind-icon">model</a> </li> <li class=" tsd-kind-accessor tsd-parent-kind-class"> <a href="ChangedEvent.html#modelChange" class="tsd-kind-icon">model<wbr>Change</a> </li> <li class=" tsd-kind-accessor tsd-parent-kind-class"> <a href="ChangedEvent.html#newParam" class="tsd-kind-icon">new<wbr>Param</a> </li> <li class=" tsd-kind-accessor tsd-parent-kind-class"> <a href="ChangedEvent.html#newValue" class="tsd-kind-icon">new<wbr>Value</a> </li> <li class=" tsd-kind-accessor tsd-parent-kind-class"> <a href="ChangedEvent.html#object" class="tsd-kind-icon">object</a> </li> <li class=" tsd-kind-accessor tsd-parent-kind-class"> <a href="ChangedEvent.html#oldParam" class="tsd-kind-icon">old<wbr>Param</a> </li> <li class=" tsd-kind-accessor tsd-parent-kind-class"> <a href="ChangedEvent.html#oldValue" class="tsd-kind-icon">old<wbr>Value</a> </li> <li class=" tsd-kind-accessor tsd-parent-kind-class"> <a href="ChangedEvent.html#propertyName" class="tsd-kind-icon">property<wbr>Name</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class"> <a href="ChangedEvent.html#canRedo" class="tsd-kind-icon">can<wbr>Redo</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class"> <a href="ChangedEvent.html#canUndo" class="tsd-kind-icon">can<wbr>Undo</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class"> <a href="ChangedEvent.html#clear" class="tsd-kind-icon">clear</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class"> <a href="ChangedEvent.html#copy" class="tsd-kind-icon">copy</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class"> <a href="ChangedEvent.html#getParam" class="tsd-kind-icon">get<wbr>Param</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class"> <a href="ChangedEvent.html#getValue" class="tsd-kind-icon">get<wbr>Value</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class"> <a href="ChangedEvent.html#redo" class="tsd-kind-icon">redo</a> </li> <li class=" tsd-kind-method tsd-parent-kind-class"> <a href="ChangedEvent.html#undo" class="tsd-kind-icon">undo</a> </li> <li class=" tsd-kind-constant tsd-parent-kind-class tsd-is-static"> <a href="ChangedEvent.html#static-Insert" class="tsd-kind-icon">Insert</a> </li> <li class=" tsd-kind-constant tsd-parent-kind-class tsd-is-static"> <a href="ChangedEvent.html#static-Property" class="tsd-kind-icon">Property</a> </li> <li class=" tsd-kind-constant tsd-parent-kind-class tsd-is-static"> <a href="ChangedEvent.html#static-Remove" class="tsd-kind-icon">Remove</a> </li> <li class=" tsd-kind-constant tsd-parent-kind-class tsd-is-static"> <a href="ChangedEvent.html#static-Transaction" class="tsd-kind-icon">Transaction</a> </li> </ul> </li> </ul> <ul class="after-current"> </ul> </nav> </div> </div> </div> <div class="container-fluid bottom-copyright plr15"> Copyright &copy; 1998-2020 by Northwoods Software Corporation. </div> <div class="overlay"></div> <script src="../assets/js/main.js"></script> <script src="../../assets/js/api.js"></script> <script src="../../assets/js/bootstrap.min.js"></script> <script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-1506307-5', 'auto'); ga('send', 'pageview'); </script> </body> </html>