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.
mxConstraintHandler | Handles constraints on connection targets. |
Functions | |
mxConstraintHandler | Constructs an new constraint handler. |
Variables | |
pointImage | mxImage to be used as the image for fixed connection points. |
graph | Reference to the enclosing mxGraph. |
enabled | Specifies if events are handled. |
highlightColor | Specifies the color for the highlight. |
Functions | |
isEnabled | Returns true if events are handled. |
setEnabled | Enables or disables event handling. |
reset | Resets the state of this handler. |
getTolerance | Returns the tolerance to be used for intersecting connection points. |
getImageForConstraint | Returns the tolerance to be used for intersecting connection points. |
isEventIgnored | Returns true if the given mxMouseEvent should be ignored in update. |
isStateIgnored | Returns true if the given state should be ignored. |
destroyIcons | Destroys the <focusIcons> if they exist. |
destroyFocusHighlight | Destroys the <focusHighlight> if one exists. |
update | Updates the state of this handler based on the given mxMouseEvent. |
destroy | Destroy this handler. |
function mxConstraintHandler( graph )
Constructs an new constraint handler.
graph | Reference to the enclosing mxGraph. |
factoryMethod | Optional function to create the edge. The function takes the source and target mxCell as the first and second argument and returns the mxCell that represents the new edge. |
mxConstraintHandler.prototype.pointImage
mxImage to be used as the image for fixed connection points.
mxConstraintHandler.prototype.graph
Reference to the enclosing mxGraph.
mxConstraintHandler.prototype.highlightColor
Specifies the color for the highlight. Default is mxConstants.DEFAULT_VALID_COLOR.
mxConstraintHandler.prototype.isEnabled = function()
Returns true if events are handled. This implementation returns enabled.
mxConstraintHandler.prototype.setEnabled = function( enabled )
Enables or disables event handling. This implementation updates enabled.
enabled | Boolean that specifies the new enabled state. |
mxConstraintHandler.prototype.isEventIgnored = function( me, source )
Returns true if the given mxMouseEvent should be ignored in update. This implementation always returns false.
mxConstraintHandler.prototype.update = function( me, source )
Updates the state of this handler based on the given mxMouseEvent. Source is a boolean indicating if the cell is a source or target.
Constructs an new constraint handler.
function mxConstraintHandler( graph )
mxImage to be used as the image for fixed connection points.
mxConstraintHandler.prototype.pointImage
Reference to the enclosing mxGraph.
mxConstraintHandler.prototype.graph
Specifies if events are handled.
mxConstraintHandler.prototype.enabled
Specifies the color for the highlight.
mxConstraintHandler.prototype.highlightColor
Returns true if events are handled.
mxConstraintHandler.prototype.isEnabled = function()
Enables or disables event handling.
mxConstraintHandler.prototype.setEnabled = function( enabled )
Resets the state of this handler.
mxConstraintHandler.prototype.reset = function()
Returns the tolerance to be used for intersecting connection points.
mxConstraintHandler.prototype.getTolerance = function()
Returns the tolerance to be used for intersecting connection points.
mxConstraintHandler.prototype.getImageForConstraint = function( state, constraint, point )
Returns true if the given mxMouseEvent should be ignored in update.
mxConstraintHandler.prototype.isEventIgnored = function( me, source )
Updates the state of this handler based on the given mxMouseEvent.
mxConstraintHandler.prototype.update = function( me, source )
Returns true if the given state should be ignored.
mxConstraintHandler.prototype.isStateIgnored = function( state, source )
Destroys the focusIcons if they exist.
mxConstraintHandler.prototype.destroyIcons = function()
Destroys the focusHighlight if one exists.
mxConstraintHandler.prototype.destroyFocusHighlight = function()
Destroy this handler.
mxConstraintHandler.prototype.destroy = function()