mxConstraintHandler

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.

Summary
mxConstraintHandlerHandles constraints on connection targets.
Functions
mxConstraintHandlerConstructs an new constraint handler.
Variables
pointImagemxImage to be used as the image for fixed connection points.
graphReference to the enclosing mxGraph.
enabledSpecifies if events are handled.
highlightColorSpecifies the color for the highlight.
Functions
isEnabledReturns true if events are handled.
setEnabledEnables or disables event handling.
resetResets the state of this handler.
getToleranceReturns the tolerance to be used for intersecting connection points.
getImageForConstraintReturns the tolerance to be used for intersecting connection points.
isEventIgnoredReturns true if the given mxMouseEvent should be ignored in update.
isStateIgnoredReturns true if the given state should be ignored.
destroyIconsDestroys the <focusIcons> if they exist.
destroyFocusHighlightDestroys the <focusHighlight> if one exists.
updateUpdates the state of this handler based on the given mxMouseEvent.
destroyDestroy this handler.

Functions

mxConstraintHandler

function mxConstraintHandler(graph)

Constructs an new constraint handler.

Parameters

graphReference to the enclosing mxGraph.
factoryMethodOptional 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.

Variables

pointImage

mxConstraintHandler.prototype.pointImage

mxImage to be used as the image for fixed connection points.

graph

mxConstraintHandler.prototype.graph

Reference to the enclosing mxGraph.

enabled

mxConstraintHandler.prototype.enabled

Specifies if events are handled.  Default is true.

highlightColor

mxConstraintHandler.prototype.highlightColor

Specifies the color for the highlight.  Default is mxConstants.DEFAULT_VALID_COLOR.

Functions

isEnabled

mxConstraintHandler.prototype.isEnabled = function()

Returns true if events are handled.  This implementation returns enabled.

setEnabled

mxConstraintHandler.prototype.setEnabled = function(enabled)

Enables or disables event handling.  This implementation updates enabled.

Parameters

enabledBoolean that specifies the new enabled state.

reset

mxConstraintHandler.prototype.reset = function()

Resets the state of this handler.

getTolerance

mxConstraintHandler.prototype.getTolerance = function()

Returns the tolerance to be used for intersecting connection points.

getImageForConstraint

mxConstraintHandler.prototype.getImageForConstraint = function(state,
constraint,
point)

Returns the tolerance to be used for intersecting connection points.

isEventIgnored

mxConstraintHandler.prototype.isEventIgnored = function(me,
source)

Returns true if the given mxMouseEvent should be ignored in update.  This implementation always returns false.

isStateIgnored

mxConstraintHandler.prototype.isStateIgnored = function(state,
source)

Returns true if the given state should be ignored.  This always returns false.

destroyIcons

mxConstraintHandler.prototype.destroyIcons = function()

Destroys the <focusIcons> if they exist.

destroyFocusHighlight

mxConstraintHandler.prototype.destroyFocusHighlight = function()

Destroys the <focusHighlight> if one exists.

update

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.

destroy

mxConstraintHandler.prototype.destroy = function()

Destroy this handler.

function mxConstraintHandler(graph)
Constructs an new constraint handler.
mxConstraintHandler.prototype.pointImage
mxImage to be used as the image for fixed connection points.
Encapsulates the URL, width and height of an image.
mxConstraintHandler.prototype.graph
Reference to the enclosing mxGraph.
Extends mxEventSource to implement a graph component for the browser.
mxConstraintHandler.prototype.enabled
Specifies if events are handled.
mxConstraintHandler.prototype.highlightColor
Specifies the color for the highlight.
mxConstraintHandler.prototype.isEnabled = function()
Returns true if events are handled.
mxConstraintHandler.prototype.setEnabled = function(enabled)
Enables or disables event handling.
mxConstraintHandler.prototype.reset = function()
Resets the state of this handler.
mxConstraintHandler.prototype.getTolerance = function()
Returns the tolerance to be used for intersecting connection points.
mxConstraintHandler.prototype.getImageForConstraint = function(state,
constraint,
point)
Returns the tolerance to be used for intersecting connection points.
mxConstraintHandler.prototype.isEventIgnored = function(me,
source)
Returns true if the given mxMouseEvent should be ignored in update.
Base class for all mouse events in mxGraph.
mxConstraintHandler.prototype.update = function(me,
source)
Updates the state of this handler based on the given mxMouseEvent.
mxConstraintHandler.prototype.isStateIgnored = function(state,
source)
Returns true if the given state should be ignored.
mxConstraintHandler.prototype.destroyIcons = function()
Destroys the focusIcons if they exist.
mxConstraintHandler.prototype.destroyFocusHighlight = function()
Destroys the focusHighlight if one exists.
mxConstraintHandler.prototype.destroy = function()
Destroy this handler.
Cells are the elements of the graph model.
Specifies the default valid colorr.
Close