@maxgraph/core
    Preparing search index...

    Class EdgeHandler

    Graph event handler that reconnects edges, modifies control points and the edge label location.

    Uses CellMarker for finding and highlighting new source and target vertices.

    This handler is automatically created in Graph.createHandler for each selected edge.

    Some elements of this handler and its subclasses can be configured using EdgeHandlerConfig.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    abspoints: (null | Point)[] = []
    active: boolean = true
    allowHandleBoundsCheck: boolean = true

    Specifies if the bounds of handles should be used for hit-detection in IE.

    true
    
    bends: Shape[] = []

    Holds the Shapes that represent the points.

    cloneEnabled: boolean = true

    Specifies if cloning by control-drag is enabled.

    true
    
    constraintHandler: ConstraintHandler

    Holds the ConstraintHandler used for drawing and highlighting constraints.

    currentPoint: null | Point = null
    customHandles: undefined | CellHandle[]
    dblClickRemoveEnabled: boolean = false

    Specifies if removing bends by double click is enabled.

    false
    
    error: null | string = null

    Holds the current validation error while a connection is being changed.

    escapeHandler: (sender: Listenable, evt: Event) => void
    graph: Graph

    Reference to the enclosing Graph.

    handleImage: null | ImageBox = null

    Optional Image to be used as handles.

    null
    
    index: null | number = null
    isLabel: boolean = false
    isSource: boolean = false
    isTarget: boolean = false
    label: Point
    labelHandleImage: null | ImageBox = null
    labelShape: Shape

    Holds the Shape that represents the label position.

    manageLabelHandle: boolean = false

    Specifies if the label handle should be moved if it intersects with another handle. Uses checkLabelHandle for checking and moving.

    false
    
    marker: CellMarker

    Holds the CellMarker which is used for highlighting terminals.

    mergeRemoveEnabled: boolean = false

    Specifies if removing bends by dropping them on other bends is enabled.

    false
    
    outline: boolean = true
    outlineConnect: boolean = false

    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.

    false
    
    parentHighlight: null | RectangleShape = null
    parentHighlightEnabled: boolean = false

    Specifies if the parent should be highlighted if a child cell is selected.

    false
    
    points: Point[] = []
    preferHtml: boolean = false

    Specifies if bends should be added to the graph container. This is updated in constructor based on whether the edge or one of its terminals has an HTML label in the container.

    shape: Shape

    Holds the Shape that represents the preview edge.

    snapPoint: null | Point = null
    snapToTerminals: boolean = false

    Specifies if waypoints should snap to the routing centers of terminals.

    false
    
    startX: number = 0
    startY: number = 0
    state: CellState

    Reference to the CellState being modified.

    straightRemoveEnabled: boolean = false

    Specifies if removing bends by creating straight segments should be enabled. If enabled, this can be overridden by holding down the alt key while moving.

    false
    
    tolerance: number = 0

    Optional tolerance for hit-detection in getHandleForEvent.

    0
    
    virtualBends: undefined | Shape[]

    Methods

    • Changes the terminal or terminal point of the given edge in the graph model.

      Parameters

      • edge: Cell

        Cell that represents the edge to be reconnected.

      • terminal: Cell

        Cell that represents the new terminal.

      • isSource: boolean

        Boolean indicating if the new terminal is the source or target terminal.

      • _isClone: boolean

        Boolean indicating if the new connection should be a clone of the old edge.

      • _me: InternalMouseEvent

        MouseEvent that contains the mouse up event.

      Returns Cell

    • Converts the given point in-place from screen to unscaled, untranslated graph coordinates and applies the grid. Returns the given, modified point instance.

      Parameters

      • point: Point

        Point to be converted.

      • gridEnabled: boolean

        Boolean that specifies if the grid should be applied.

      Returns Point

    • Creates the shape used to display the given bend. Note that the index

      Only images and rectangles should be returned if support for HTML labels with not foreign objects is required.

      Parameters

      • Optional_index: number

      Returns Shape

    • Returns the fillcolor for the handle at the given index.

      Parameters

      • index: number

      Returns string

    • Returns the tolerance for the guides. Default value is gridSize * scale / 2.

      Returns number

    • Helper method to initialize the given bend.

      Parameters

      • bend: Shape

        Shape that represents the bend to be initialized.

      • OptionaldblClick: (evt: MouseEvent) => void

        Optional function to be called on double click.

      Returns void

    • Returns true if the given event is a trigger to add a new Point. This implementation returns true if shift is pressed.

      Parameters

      • evt: MouseEvent

      Returns boolean

    • Returns true if the given cell allows new connections to be created. This implementation always returns true.

      Parameters

      Returns boolean

    • Returns true if the given cell is connectable. This is a hook to disable floating connections. This implementation returns true.

      Parameters

      Returns boolean

    • Creates the shape used to display the given bend.

      Parameters

      • index: number

      Returns boolean

    • Returns true if the handle at the given index is visible.

      Parameters

      • index: number

      Returns boolean

    • Returns true if the parent highlight should be visible. This implementation always returns true.

      Returns null | boolean

    • Returns true if the given event is a trigger to remove a point. This implementation returns true if shift is pressed.

      Parameters

      • evt: MouseEvent

      Returns boolean

    • Returns true if virtual bends should be added. This returns true if virtualBendsEnabled is true and the current style allows and renders custom waypoints.

      Parameters

      • Optionalevt: Event

      Returns undefined | boolean

    • Changes the coordinates for the label of the given edge.

      Parameters

      • edgeState: CellState
      • x: number

        Integer that specifies the x-coordinate of the new location.

      • y: number

        Integer that specifies the y-coordinate of the new location.

      Returns void

    • Destroys the handler and all its resources and DOM nodes. This does normally not need to be called as handlers are destroyed automatically when the corresponding cell is deselected.

      Returns void

    • Redraws the preview, and the bends- and label control points.

      Parameters

      • OptionalignoreHandles: boolean

      Returns void

    • Hook for rounding the unscaled width or height. This uses Math.round.

      Parameters

      • length: number

      Returns number

    • Sets the color of the preview to the given value.

      Parameters

      • color: string

      Returns void

    • Starts the handling of the mouse gesture.

      Parameters

      • x: number
      • y: number
      • index: number

      Returns void

    • 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 Graph#getEdgeValidationError.

      Parameters

      • source: null | Cell

        Cell that represents the source terminal.

      • target: null | Cell

        Cell that represents the target terminal.

      Returns null | string