Class ConnectorBaseEditor

ConnectorBaseEditor covers basic connector creating and editing features. It is used to edit most of the common connector types that don't require some special editor treatment.

Hierarchy

  • ConnectorBaseEditor

Constructors

Properties

_container: SVGGElement

SVG group container encapsulating all the connector's elements.

_isSelected: boolean = false

Is connector selected?

_language: Language

Language (localization) subsystem instance.

_state: ConnectorState = 'new'

Current state of the connector editor.

activeGrip?: ResizeGrip

Active manipulation grip.

connector: ConnectorBase

Connector being edited by this connector editor.

controlBox: SVGGElement

Container for control elements.

grip1: ResizeGrip

First manipulation grip

grip2: ResizeGrip

Second manipulation grip.

manipulationStartX: number = 0

Initial X coordinate where pointer manipulation has started.

manipulationStartY: number = 0

Initial Y coordinate where pointer manipulation has started.

movingPort?: Port

Reference to the port being moved.

overlayContainer: HTMLDivElement

HTML overlay container for editor elements like text editor, etc.

prevX: number = 0

Pointer's X coordinate after the previous pointer event.

prevY: number = 0

Pointer's Y coordinate after the previous pointer event.

Accessors

  • get container(): SVGGElement
  • Returns the SVG group container for the connector's elements.

    Returns SVGGElement

  • get isSelected(): boolean
  • Returns true if the connector is currently selected.

    Returns boolean

Methods

  • Adds control grips to the editor.

    Returns void

  • Handles double-click event on the connector - opens the text editor for the label.

    Parameters

    • point: IPoint

      pointer location.

    • Optional target: EventTarget

      immediate event target.

    Returns void

  • Deselects the connector.

    Returns void

  • Disposes of the editor.

    Returns void

  • Hides the connector editor controls.

    Returns void

  • Handles pointer manipulation depending on the editor's state (movement, resizing, etc.)

    Parameters

    • point: IPoint

      pointer location.

    Returns void

  • Returns true if the supplied element (event target) belongs to this connector or connector editor.

    Parameters

    • el: null | EventTarget

      target element.

    Returns boolean

    true if the element belongs to the connector or editor.

  • Handles pointerdown event on the connector editor.

    Parameters

    • point: IPoint

      pointer location.

    • Optional target: EventTarget

      immediate pointer event target.

    Returns void

  • Handles the pointerup event.

    Parameters

    • point: IPoint

      pointer location.

    Returns void

  • Positions a control grip at specified location.

    Parameters

    • grip: SVGGraphicsElement

      grip to position.

    • x: number

      horizontal coordinate.

    • y: number

      vertical coordinate.

    Returns void

  • Positions control grips according to the connector's position.

    Returns void

  • Resizes the connector.

    Parameters

    • point: IPoint

      pointer location.

    Returns void

  • Restores the connector's state and adjusts the editor accordingly.

    Parameters

    Returns void

  • Scales the connector and editor.

    Parameters

    • scaleX: number

      horizontal scale factor.

    • scaleY: number

      vertical scale factor.

    Returns void

  • Selects the connector.

    Returns void

  • Creates the control box for the editor.

    Returns void

  • Shows the connector editor controls.

    Returns void

Events

onConnectorCreated?: ((connector) => void)

Type declaration

    • (connector): void
    • Fired when the connector creation is completed.

      Parameters

      Returns void

onConnectorUpdated?: ((connector) => void)

Type declaration

    • (connector): void
    • Fired when the connector is changed (moved, edited, etc.).

      Parameters

      Returns void

Generated using TypeDoc