<divid=Content><divclass="CClass"><divclass=CTopicid=MainTopic><h1class=CTitle><aname="mxConstraintHandler"></a>mxConstraintHandler</h1><divclass=CBody><p>Handles constraints on connection targets. This class is in charge of showing fixed points when the mouse is over a vertex and handles constraints to establish new connections.</p><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SMain"><tdclass=SEntry><ahref="#mxConstraintHandler">mxConstraintHandler</a></td><tdclass=SDescription>Handles constraints on connection targets. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxConstraintHandler.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxConstraintHandler.mxConstraintHandler"id=link1onMouseOver="ShowTip(event, 'tt1', 'link1')"onMouseOut="HideTip('tt1')">mxConstraintHandler</a></td><tdclass=SDescription>Constructs an new constraint handler.</td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxConstraintHandler.Variables">Variables</a></td><tdclass=SDescription></td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxConstraintHandler.pointImage"id=link2onMouseOver="ShowTip(event, 'tt2', 'link2')"onMouseOut="HideTip('tt2')">pointImage</a></td><tdclass=SDescription><ahref="../util/mxImage-js.html#mxImage"class=LClassid=link3onMouseOver="ShowTip(event, 'tt3', 'link3')"onMouseOut="HideTip('tt3')">mxImage</a> to be used as the image for fixed connection points.</td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxConstraintHandler.graph"id=link4onMouseOver="ShowTip(event, 'tt4', 'link4')"onMouseOut="HideTip('tt4')">graph</a></td><tdclass=SDescription>Reference to the enclosing <ahref="../view/mxGraph-js.html#mxGraph"class=LClassid=link5onMouseOver="ShowTip(event, 'tt5', 'link5')"onMouseOut="HideTip('tt5')">mxGraph</a>.</td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxConstraintHandler.enabled"id=link6onMouseOver="ShowTip(event, 'tt6', 'link6')"onMouseOut="HideTip('tt6')">enabled</a></td><tdclass=SDescription>Specifies if events are handled. </td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxConstraintHandler.highlightColor"id=link7onMouseOver="ShowTip(event, 'tt7', 'link7')"onMouseOut="HideTip('tt7')">highlightColor</a></td><tdclass=SDescription>Specifies the color for the highlight. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxConstraintHandler.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxConstraintHandler.isEnabled"id=link8onMouseOver="ShowTip(event, 'tt8', 'link8')"onMouseOut="HideTip('tt8')">isEnabled</a></td><tdclass=SDescription>Returns true if events are handled. </td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxConstraintHandler.setEnabled"id=link9onMouseOver="ShowTip(event, 'tt9', 'link9')"onMouseOut="HideTip('tt9')">setEnabled</a></td><tdclass=SDescription>Enables or disables event handling. </td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxConstraintHandler.reset"id=link10onMouseOver="ShowTip(event, 'tt10', 'link10')"onMouseOut="HideTip('tt10')">reset</a></td><tdclass=SDescription>Resets the state of this handler.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxConstraintHandler.getTolerance"id=link11onMouseOver="ShowTip(event, 'tt11', 'link11')"onMouseOut="HideTip('tt11')">getTolerance</a></td><tdclass=SDescription>Returns the tolerance to be used for intersecting connection points.</td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxConstraintHandler.getImageForConstraint"id=link12onMouseOver="ShowTip(event, 'tt12', 'link12')"onMouseOut="HideTip('tt12')">getImageForConstraint</a></td><tdclass=SDescription>Returns the tolerance to be used for int
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxConstraintHandler.mxConstraintHandler"></a>mxConstraintHandler</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function mxConstraintHandler(</td><tdclass=PParameternowrap>graph</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Constructs an new constraint handler.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>graph</td><tdclass=CDLDescription>Reference to the enclosing <ahref="../view/mxGraph-js.html#mxGraph"class=LClassid=link20onMouseOver="ShowTip(event, 'tt5', 'link20')"onMouseOut="HideTip('tt5')">mxGraph</a>.</td></tr><tr><tdclass=CDLEntry>factoryMethod</td><tdclass=CDLDescription>Optional function to create the edge. The function takes the source and target <ahref="../model/mxCell-js.html#mxCell"class=LClassid=link21onMouseOver="ShowTip(event, 'tt18', 'link21')"onMouseOut="HideTip('tt18')">mxCell</a> as the first and second argument and returns the <ahref="../model/mxCell-js.html#mxCell"class=LClassid=link22onMouseOver="ShowTip(event, 'tt18', 'link22')"onMouseOut="HideTip('tt18')">mxCell</a> that represents the new edge.</td></tr></table></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxConstraintHandler.pointImage"></a>pointImage</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxConstraintHandler.prototype.pointImage</td></tr></table></blockquote><p><ahref="../util/mxImage-js.html#mxImage"class=LClassid=link23onMouseOver="ShowTip(event, 'tt3', 'link23')"onMouseOut="HideTip('tt3')">mxImage</a> to be used as the image for fixed connection points.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxConstraintHandler.graph"></a>graph</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxConstraintHandler.prototype.graph</td></tr></table></blockquote><p>Reference to the enclosing <ahref="../view/mxGraph-js.html#mxGraph"class=LClassid=link24onMouseOver="ShowTip(event, 'tt5', 'link24')"onMouseOut="HideTip('tt5')">mxGraph</a>.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxConstraintHandler.enabled"></a>enabled</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxConstraintHandler.prototype.enabled</td></tr></table></blockquote><p>Specifies if events are handled. Default is true.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxConstraintHandler.highlightColor"></a>highlightColor</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxConstraintHandler.prototype.highlightColor</td></tr></table></blockquote><p>Specifies the color for the highlight. Default is <ahref="../util/mxConstants-js.html#mxConstants.DEFAULT_VALID_COLOR"class=LVariableid=link25onMouseOver="ShowTip(event, 'tt19', 'link25')"onMouseOut="HideTip('tt19')">mxConstants.DEFAULT_VALID_COLOR</a>.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxConstraintHandler.isEnabled"></a>isEnabled</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxConstraintHandler.prototype.isEnabled = function()</td></tr></table></blockquote><p>Returns true if events are handled. This implementation returns <ahref="#mxConstraintHandler.enabled"class=LVariableid=link26onMouseOver="ShowTip(event, 'tt6', 'link26')"onMouseOut="HideTip('tt6')">enabled</a>.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxConstraintHandler.setEnabled"></a>setEnabled</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxConstraintHandler.prototype.setEnabled = function(</td><tdclass=PParameternowrap>enabled</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Enables or disables event handling. This implementation updates <ahref="#mxConstraintHandler.enabled"class=LVariableid=link27onMouseOver="ShowTip(event, 'tt6', 'link27')"onMouseOut="HideTip('tt6')">enabled</a>.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>enabled</td><tdclass=CDLDescription>Boolean that specifies the new enabled state.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxConstraintHandler.reset"></a>reset</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxConstraintHandler.prototype.reset = function()</td></tr></table></blockquote><p>Resets the state of this handler.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxConstraintHandler.getTolerance"></a>getTolerance</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxConstraintHandler.prototype.getTolerance = function()</td></tr></table></blockquote><p>Returns the tolerance to be used for intersecting connection points.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxConstraintHandler.getImageForConstraint"></a>getImageForConstraint</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxConstraintHandler.prototype.getImageForConstraint = function(</td><tdclass=PParameternowrap>state,</td></tr><tr><td></td><tdclass=PParameternowrap>constraint,</td></tr><tr><td></td><tdclass=PParameternowrap>point</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the tolerance to be used for intersecting connection points.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxConstraintHandler.isEventIgnored"></a>isEventIgnored</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxConstraintHandler.prototype.isEventIgnored = function(</td><tdclass=PParameternowrap>me,</td></tr><tr><td></td><tdclass=PParameternowrap>source</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns true if the given <ahref="../util/mxMouseEvent-js.html#mxMouseEvent"class=LClassid=link28onMouseOver="ShowTip(event, 'tt14', 'link28')"onMouseOut="HideTip('tt14')">mxMouseEvent</a> should be ignored in <ahref="#mxConstraintHandler.update"class=LFunctionid=link29onMouseOver="ShowTip(event, 'tt15', 'link29')"onMouseOut="HideTip('tt15')">update</a>. This implementation always returns false.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxConstraintHandler.isStateIgnored"></a>isStateIgnored</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxConstraintHandler.prototype.isStateIgnored = function(</td><tdclass=PParameternowrap>state,</td></tr><tr><td></td><tdclass=PParameternowrap>source</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns true if the given state should be ignored. This always returns false.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxConstraintHandler.update"></a>update</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxConstraintHandler.prototype.update = function(</td><tdclass=PParameternowrap>me,</td></tr><tr><td></td><tdclass=PParameternowrap>source</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Updates the state of this handler based on the given <ahref="../util/mxMouseEvent-js.html#mxMouseEvent"class=LClassid=link30onMouseOver="ShowTip(event, 'tt14', 'link30')"onMouseOut="HideTip('tt14')">mxMouseEvent</a>. Source is a boolean indicating if the cell is a source or target.</p></div></div></div>
<divclass=CToolTipid="tt1"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function mxConstraintHandler(</td><tdclass=PParameternowrap>graph</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Constructs an new constraint handler.</div></div><divclass=CToolTipid="tt2"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxConstraintHandler.prototype.pointImage</td></tr></table></blockquote>mxImage to be used as the image for fixed connection points.</div></div><divclass=CToolTipid="tt3"><divclass=CClass>Encapsulates the URL, width and height of an image.</div></div><divclass=CToolTipid="tt4"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxConstraintHandler.prototype.graph</td></tr></table></blockquote>Reference to the enclosing mxGraph.</div></div><divclass=CToolTipid="tt5"><divclass=CClass>Extends mxEventSource to implement a graph component for the browser. </div></div><divclass=CToolTipid="tt6"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxConstraintHandler.prototype.enabled</td></tr></table></blockquote>Specifies if events are handled. </div></div><divclass=CToolTipid="tt7"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxConstraintHandler.prototype.highlightColor</td></tr></table></blockquote>Specifies the color for the highlight. </div></div><divclass=CToolTipid="tt8"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxConstraintHandler.prototype.isEnabled = function()</td></tr></table></blockquote>Returns true if events are handled. </div></div><divclass=CToolTipid="tt9"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxConstraintHandler.prototype.setEnabled = function(</td><tdclass=PParameternowrap>enabled</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Enables or disables event handling. </div></div><divclass=CToolTipid="tt10"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxConstraintHandler.prototype.reset = function()</td></tr></table></blockquote>Resets the state of this handler.</div></div><divclass=CToolTipid="tt11"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxConstraintHandler.prototype.getTolerance = function()</td></tr></table></blockquote>Returns the tolerance to be used for intersecting connection points.</div></div><divclass=CToolTipid="tt12"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxConstraintHandler.prototype.getImageForConstraint = function(</td><tdclass=PParameternowrap>state,</td></tr><tr><td></td><tdclass=PParameternowrap>constraint,</td></tr><tr><td></td><tdclass=PParameternowrap>point</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Returns the tolerance to be used for intersecting connection points.</div></div><divclass=CToolTipid="tt13"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxConstraintHandler.prototype.isEventIgnored = function(</td><tdclass=PParameternowrap>me,</td></tr><tr><td></td><tdclass=PParameternowrap>source</td><tdclass=PAfterParametersnowrap>)</td></t