GeezerVison is showing maxgraph.github.io — ConstraintHandler | @maxgraph/core
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.
Constructors
constructor
-
Returns ConstraintHandler
Properties
currentPoint
currentPoint: Point | null = null
enabled
enabled: boolean = true
Specifies if events are handled. Default is true.
focusPoints
focusPoints: Point[] = []
highlightColor
highlightColor: string = DEFAULT_VALID_COLOR
mouseleaveHandler
mouseleaveHandler: (() => void) | null = null
pointImage
Image to be used as the image for fixed connection points.
resetHandler
resetHandler: () => void
Methods
createHighlightShape
-
Create the shape used to paint the highlight.
Returns true if the given icon intersects the given point.
destroyFocusHighlight
-
destroyFocusHighlight(): void
getCellForEvent
-
Returns the cell for the given event.
Returns Cell | null
getImageForConstraint
-
Returns the tolerance to be used for intersecting connection points.
getTolerance
-
Returns the tolerance to be used for intersecting connection points. This
implementation returns mxGraph.tolerance.
Returns number
intersects
-
intersects( icon: ImageShape, rectangle: Rectangle, source: boolean, existingEdge: boolean,): boolean
Returns true if the given icon intersects the given rectangle.
Returns boolean
isEnabled
-
Returns true if events are handled. This implementation
returns enabled.
Returns boolean
isEventIgnored
-
Returns true if the given mxMouseEvent should be ignored in update. This
implementation always returns false.
Returns boolean
isKeepFocusEvent
-
Returns true if the current focused state should not be changed for the given event.
This returns true if shift and alt are pressed.
Returns boolean
isStateIgnored
-
isStateIgnored(state: CellState, source?: boolean): boolean
Returns true if the given state should be ignored. This always returns false.
Returns boolean
redraw
-
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
reset
-
Resets the state of this handler.
Returns void
setEnabled
-
setEnabled(enabled: boolean): void
Enables or disables event handling. This implementation
updates enabled.
Parameters
- enabled: boolean
Boolean that specifies the new enabled state.
Returns void
setFocus
-
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
update
-
Updates the state of this handler based on the given mxMouseEvent.
Source is a boolean indicating if the cell is a source or target.
Returns void
On This Page
Constructors
Properties
Methods