Class ConstraintHandler

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.

ConstraintHandler

Constructors

Properties

constraints: null | ConnectionConstraint[] = null
currentConstraint: null | ConnectionConstraint = null
currentFocus: null | CellState = null
currentFocusArea: null | Rectangle = null
currentPoint: null | Point = null
enabled: boolean = true

Specifies if events are handled. Default is true.

focusHighlight: null | RectangleShape = null
focusIcons: ImageShape[] = []
focusPoints: Point[] = []
graph: Graph

Reference to the enclosing mxGraph.

highlightColor: string = DEFAULT_VALID_COLOR

Specifies the color for the highlight. Default is DEFAULT_VALID_COLOR.

mouseleaveHandler: null | (() => void) = null
pointImage: ImageBox = ...

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

resetHandler: (() => void)

Methods

  • Returns the tolerance to be used for intersecting connection points. This implementation returns mxGraph.tolerance.

    Parameters

    Returns number

  • Transfers the focus to the given state as a source or target terminal. If the handler is not enabled then the outline is painted, but the constraints are ignored.

    Returns void

  • Enables or disables event handling. This implementation updates enabled.

    Parameters

    • enabled: boolean

      Boolean that specifies the new enabled state.

    Returns void

  • Transfers the focus to the given state as a source or target terminal. If the handler is not enabled then the outline is painted, but the constraints are ignored.

    Parameters

    Returns void

  • Updates the state of this handler based on the given mxMouseEvent. Source is a boolean indicating if the cell is a source or target.

    Parameters

    Returns void