GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • @maxgraph/core

This view

  • Original page
  • New address

GeezerVison is showing maxgraph.github.io — ConstraintHandler | @maxgraph/core

  • ConstraintHandler

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.

  • Defined in view/handler/ConstraintHandler.ts:46
Index

Constructors

constructor

Properties

constraints currentConstraint currentFocus currentFocusArea currentPoint enabled focusHighlight focusIcons focusPoints graph highlightColor mouseleaveHandler pointImage resetHandler

Methods

createHighlightShape destroyFocusHighlight destroyIcons getCellForEvent getImageForConstraint getTolerance intersects isEnabled isEventIgnored isKeepFocusEvent isStateIgnored onDestroy redraw reset setEnabled setFocus update

Constructors

constructor

  • new ConstraintHandler(graph: AbstractGraph): ConstraintHandler

    Parameters

    • graph: AbstractGraph

    Returns ConstraintHandler

    • Defined in view/handler/ConstraintHandler.ts:87

Properties

constraints

constraints: ConnectionConstraint[] | null = null
  • Defined in view/handler/ConstraintHandler.ts:65

currentConstraint

currentConstraint: ConnectionConstraint | null = null
  • Defined in view/handler/ConstraintHandler.ts:67

currentFocus

currentFocus: CellState | null = null
  • Defined in view/handler/ConstraintHandler.ts:59

currentFocusArea

currentFocusArea: Rectangle | null = null
  • Defined in view/handler/ConstraintHandler.ts:61

currentPoint

currentPoint: Point | null = null
  • Defined in view/handler/ConstraintHandler.ts:73

enabled

enabled: boolean = true

Specifies if events are handled. Default is true.

  • Defined in view/handler/ConstraintHandler.ts:78

focusHighlight

focusHighlight: RectangleShape | null = null
  • Defined in view/handler/ConstraintHandler.ts:69

focusIcons

focusIcons: ImageShape[] = []
  • Defined in view/handler/ConstraintHandler.ts:63

focusPoints

focusPoints: Point[] = []
  • Defined in view/handler/ConstraintHandler.ts:71

graph

graph: AbstractGraph

Reference to the enclosing AbstractGraph.

  • Defined in view/handler/ConstraintHandler.ts:55

highlightColor

highlightColor: string = DEFAULT_VALID_COLOR

Specifies the color for the highlight. Default is DEFAULT_VALID_COLOR.

  • Defined in view/handler/ConstraintHandler.ts:83

mouseleaveHandler

mouseleaveHandler: (() => void) | null = null
  • Defined in view/handler/ConstraintHandler.ts:85

pointImage

pointImage: ImageBox = ...

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

  • Defined in view/handler/ConstraintHandler.ts:50

resetHandler

resetHandler: () => void
  • Defined in view/handler/ConstraintHandler.ts:57

Methods

createHighlightShape

  • createHighlightShape(): RectangleShape

    Create the shape used to paint the highlight.

    Returns true if the given icon intersects the given point.

    Returns RectangleShape

    • Defined in view/handler/ConstraintHandler.ts:451

destroyFocusHighlight

  • destroyFocusHighlight(): void

    Destroys the focusHighlight if one exists.

    Returns void

    • Defined in view/handler/ConstraintHandler.ts:197

destroyIcons

  • destroyIcons(): void

    Destroys the focusIcons if they exist.

    Returns void

    • Defined in view/handler/ConstraintHandler.ts:185

getCellForEvent

  • getCellForEvent(me: InternalMouseEvent, point: Point | null): Cell | null

    Returns the cell for the given event.

    Parameters

    • me: InternalMouseEvent
    • point: Point | null

    Returns Cell | null

    • Defined in view/handler/ConstraintHandler.ts:215

getImageForConstraint

  • getImageForConstraint(
        state: CellState,
        constraint: ConnectionConstraint,
        point: Point,
    ): ImageBox

    Returns the tolerance to be used for intersecting connection points.

    Parameters

    • state: CellState
    • constraint: ConnectionConstraint
    • point: Point

    Returns ImageBox

    • Defined in view/handler/ConstraintHandler.ts:159

getTolerance

  • getTolerance(me: InternalMouseEvent): number

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

    Parameters

    • me: InternalMouseEvent

      mxMouseEvent whose tolerance should be returned.

    Returns number

    • Defined in view/handler/ConstraintHandler.ts:152

intersects

  • intersects(
        icon: ImageShape,
        rectangle: Rectangle,
        source: boolean,
        existingEdge: boolean,
    ): boolean

    Returns true if the given icon intersects the given rectangle.

    Parameters

    • icon: ImageShape
    • rectangle: Rectangle
    • source: boolean
    • existingEdge: boolean

    Returns boolean

    • Defined in view/handler/ConstraintHandler.ts:466

isEnabled

  • isEnabled(): boolean

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

    Returns boolean

    • Defined in view/handler/ConstraintHandler.ts:110

isEventIgnored

  • isEventIgnored(me: InternalMouseEvent, source?: boolean): boolean

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

    Parameters

    • me: InternalMouseEvent
    • source: boolean = false

    Returns boolean

    • Defined in view/handler/ConstraintHandler.ts:171

isKeepFocusEvent

  • isKeepFocusEvent(me: InternalMouseEvent): boolean

    Returns true if the current focused state should not be changed for the given event. This returns true if shift and alt are pressed.

    Parameters

    • me: InternalMouseEvent

    Returns boolean

    • Defined in view/handler/ConstraintHandler.ts:208

isStateIgnored

  • isStateIgnored(state: CellState, source?: boolean): boolean

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

    Parameters

    • state: CellState
    • source: boolean = false

    Returns boolean

    • Defined in view/handler/ConstraintHandler.ts:178

onDestroy

  • onDestroy(): void

    Destroy this handler.

    Returns void

    • Defined in view/handler/ConstraintHandler.ts:478

redraw

  • redraw(): 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.

    Returns void

    • Defined in view/handler/ConstraintHandler.ts:357

reset

  • reset(): void

    Resets the state of this handler.

    Returns void

    • Defined in view/handler/ConstraintHandler.ts:127

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

    • Defined in view/handler/ConstraintHandler.ts:120

setFocus

  • setFocus(me: InternalMouseEvent, state: CellState | null, source: boolean): 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

    • me: InternalMouseEvent
    • state: CellState | null
    • source: boolean

    Returns void

    • Defined in view/handler/ConstraintHandler.ts:386

update

  • update(
        me: InternalMouseEvent,
        source: boolean,
        existingEdge: boolean,
        point: Point | null,
    ): 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

    • me: InternalMouseEvent
    • source: boolean
    • existingEdge: boolean
    • point: Point | null

    Returns void

    • Defined in view/handler/ConstraintHandler.ts:243

Settings

Member Visibility
  • Protected
  • Inherited
Theme

On This Page

Constructors
constructor
Properties
constraintscurrentConstraintcurrentFocuscurrentFocusAreacurrentPointenabledfocusHighlightfocusIconsfocusPointsgraphhighlightColormouseleaveHandlerpointImageresetHandler
Methods
createHighlightShapedestroyFocusHighlightdestroyIconsgetCellForEventgetImageForConstraintgetToleranceintersectsisEnabledisEventIgnoredisKeepFocusEventisStateIgnoredonDestroyredrawresetsetEnabledsetFocusupdate
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.