Variable: connectIconOffset
Holds the offset for connect icons during connection preview. Default is mxPoint(0, <mxConstants.TOOLTIP_VERTICAL_OFFSET>). Note that placing the icon under the mouse pointer with an offset of (0,0) will affect hit detection.
Variable: connectImage
Variable: constraintHandler
Holds the
Variable: createTarget
Specifies if
Variable: cursor
Specifies the cursor to be used while the handler is active. Default is null.
Variable: drillHandler
Holds the drill event listener for later removal.
Variable: edgeState
Optional
Variable: enabled
Specifies if events are handled. Default is true.
Variable: error
Holds the current validation error while connections are being created.
Variable: eventListeners
Holds the event names and associated listeners in an array. The array contains the event name followed by the respective listener for each registered listener.
Variable: eventSource
Optional source for events. Default is null.
Variable: eventsEnabled
Specifies if events can be fired. Default is true.
Variable: factoryMethod
Function that is used for creating new edges. The function takes the
source and target
Variable: first
Holds the
Variable: graph
Reference to the enclosing
Variable: ignoreMouseDown
Specifies if the connection handler should ignore the state of the mouse button when highlighting the source. Default is false, that is, the handler only highlights the source if no button is being pressed.
Variable: insertBeforeSource
Specifies if new edges should be inserted before the source vertex in the cell hierarchy. Default is false for backwards compatibility.
Variable: livePreview
Specifies if the actual shape of the edge state should be used for the preview.
Default is false. (Ignored if no edge state is created in
Variable: marker
Holds the
Variable: mouseDownCounter
Counts the number of mouseDown events since the start. The initial mouse down event counts as 1.
Variable: moveIconBack
Specifies if icons should be moved to the back of the overlay pane. This can be set to true if the icons of the connection handler conflict with other handles, such as the vertex label move handle. Default is false.
Variable: moveIconFront
Specifies if icons should be displayed inside the graph container instead
of the overlay pane. This is used for HTML labels on vertices which hide
the connect icon. This has precendence over
Variable: movePreviewAway
Switch to enable moving the preview away from the mousepointer. This is required in browsers where the preview cannot be made transparent to events and if the built-in hit detection on the HTML elements in the page should be used. Default is the value of <mxClient.IS_VML>.
Variable: outlineConnect
Specifies if connections to the outline of a highlighted target should be enabled. This will allow to place the connection point along the outline of the highlighted target. Default is false.
Variable: select
Specifies if new edges should be selected. Default is true.
Variable: targetConnectImage
Specifies if the connect icon should be centered on the target state while connections are being previewed. Default is false.
Variable: waypointsEnabled
Specifies if single clicks should add waypoints on the new edge. Default is false.
Function: addListener
Binds the specified function to the given event name. If no event name is given, then the listener is registered for all events.
The parameters of the listener are the sender and an
Function: addWaypoint
Adds the waypoint for the given event to
Function: connect
Connects the given source and target using a new edge. This
implementation uses
Parameters:
source -
Function: convertWaypoint
Converts the given point from screen coordinates to model coordinates.
Function: createEdge
Creates and returns a new edge using
Parameters:
value - Value to be used for creating the edge.
source -
Function: createEdgeState
Hook to return an
Use the following code to create a preview for an existing edge style:
(code) graph.connectionHandler.createEdgeState(me) { var edge = graph.createEdge(null, null, null, null, null, 'edgeStyle=elbowEdgeStyle');
return new mxCellState(this.graph.view, edge, this.graph.getCellStyle(edge)); }; (end)
Function: createIcons
Creates the array
Parameters:
state -
Function: createMarker
Creates and returns the
Function: createShape
Creates the preview shape for new connections.
Function: createTargetVertex
Hook method for creating new vertices on the fly if no target was
under the mouse. This is only called if
Parameters:
evt - Mousedown event of the connect gesture.
source -
Function: destroy
Destroys the handler and all its resources and DOM nodes. This should be
called on all instances. It is called automatically for the built-in
instance created for each
Function: destroyIcons
Destroys the connect icons and resets the respective state.
Function: drawPreview
Redraws the preview edge using the color and width returned by
Function: fireEvent
Dispatches the given event to the listeners which are registered for the event. The sender argument is optional. The current execution scope ("this") is used for the listener invocation (see <mxUtils.bind>).
Example:
(code) fireEvent(new mxEventObject("eventName", key1, val1, .., keyN, valN)) (end)
Parameters:
evt -
Function: getAlignmentTolerance
Returns the tolerance for aligning new targets to sources. This returns the grid size / 2.
Function: getConnectImage
Hook to return the
Parameters:
state -
Function: getEdgeColor
Returns the color used to draw the preview edge. This returns green if there is no edge validation error and red otherwise.
Parameters:
valid - Boolean indicating if the color for a valid edge should be returned.
Function: getEdgeWidth
Returns the width used to draw the preview edge. This returns 3 if there is no edge validation error and 1 otherwise.
Parameters:
valid - Boolean indicating if the width for a valid edge should be returned.
Function: getEventSource
Returns
Function: redrawIcons
Redraws the given array of
Parameters:
icons - Optional array of
Function: getSourcePerimeterPoint
Hook to update the icon position(s) based on a mouseOver event. This is an empty implementation.
Parameters:
state -
Function: getTargetPerimeterPoint
Returns the perimeter point for the given target state.
Parameters:
state -
Function: init
Initializes the shapes required for this connection handler. This should be invoked if <mxGraph.container> is assigned after the connection handler has been created.
Function: isCellEnabled
Returns true if the given cell does not allow new connections to be created.
Function: isConnectableCell
Returns true if the given cell is connectable. This is a hook to disable floating connections. This implementation returns true.
Function: isConnecting
Returns true if the source terminal has been clicked and a new connection is currently being previewed.
Function: isCreateTarget
Returns
Parameters:
evt - Current active native pointer event.
Function: isEnabled
Returns true if events are handled. This implementation
returns
Function: isEventsEnabled
Returns
Function: isImmediateConnectSource
Returns true if a tap on the given source state should immediately start connecting. This implementation returns true if the state is not movable in the graph.
Function: isInsertBefore
Returns
Parameters:
edge -
Function: isMoveIconToFrontForState
Returns true if the state has a HTML label in the graph's container, otherwise
it returns
Parameters:
state -
Function: isOutlineConnectEvent
Returns true if
Function: isStartEvent
Returns true if the given mouse down event should start this handler. The
This implementation returns true if the event does not force marquee
selection, and the currentConstraint and currentFocus of the
Function: isStopEvent
Returns true if the given mouse up event should stop this handler. The
connection will be created if
Function: isValidSource
Returns <mxGraph.isValidSource> for the given source terminal.
Parameters:
cell -
Function: isValidTarget
Returns true. The call to <mxGraph.isValidTarget> is implicit by calling
<mxGraph.getEdgeValidationError> in
Parameters:
cell -
Function: mouseDown
Handles the event by initiating a new connection.
Function: mouseMove
Handles the event by updating the preview edge or by highlighting a possible source or target terminal.
Function: mouseUp
Handles the event by inserting the new connection.
Function: redrawIcons
Redraws the given array of
Parameters:
icons - Optional array of
Function: removeListener
Removes all occurrences of the given listener from
Function: reset
Resets the state of this handler.
Function: setCreateTarget
Sets
Function: setEnabled
Enables or disables event handling. This implementation
updates
Parameters:
enabled - Boolean that specifies the new enabled state.
Function: setEventSource
Sets
Function: setEventsEnabled
Sets
Function: snapToPreview
Called to snap the given point to the current preview. This snaps to the first point of the preview if alt is not pressed.
Function: start
Starts a new connection for the given state and coordinates.
Function: updateCurrentState
Updates the current state for a given mouse move event by using
the
Function: updateEdgeState
Updates
Function: updateIcons
Hook to update the icon position(s) based on a mouseOver event. This is an empty implementation.
Parameters:
state -
Function: getEdgeColor
Returns the color used to draw the preview edge. This returns green if there is no edge validation error and red otherwise.
Parameters:
valid - Boolean indicating if the color for a valid edge should be returned.
Function: validateConnection
Returns the error message or an empty string if the connection for the given source target pair is not valid. Otherwise it returns null. This implementation uses <mxGraph.getEdgeValidationError>.
Parameters:
source -
Generated using TypeDoc
Variable: changeHandler
Holds the change event listener for later removal.