Class CustomImageStencilEditor

Specialized stencil editor for custom image stencils.

See

CustomImageStencil

Hierarchy

Constructors

Properties

_connectorOutline?: SVGPathElement

Outline displayed in "connect" mode.

_container: SVGGElement

SVG container for the stencil's and editor's visual elements.

_controlBox: SVGGElement = ...

SVG group holding editor's control box.

_gripBox: SVGGElement = ...

SVG group holding resize grips.

_isFocused: boolean = false

Is stencil in focus?

_isSelected: boolean = false

Is stencil selected?

_language: Language

Language (localization) subsystem.

_overlayContainer: HTMLDivElement

Overlay container for HTML elements like text editors, etc.

_portBox: SVGGElement = ...

SVG group for holding connector ports.

_state: StencilEditorState = 'new'

Editor's state.

_stencil: StencilBase

Stencil being edited.

_stencilType: typeof StencilBase

Type of the edited stencil.

_suppressStencilCreateEvent: boolean = false

When set to true stencilcreate event isn't fired.

activeGrip?: ResizeGrip

Currently active grip.

manipulationStartHeight: number = 0

Height at the start of manipulation.

manipulationStartLeft: number = 0

x coordinate of the top-left corner at the start of manipulation.

manipulationStartTop: number = 0

y coordinate of the top-left corner at the start of manipulation.

manipulationStartWidth: number = 0

Width at the start of manipulation.

manipulationStartX: number = 0

x coordinate of the pointer at the start of manipulation.

manipulationStartY: number = 0

y coordinate of the pointer at the start of manipulation.

offsetX: number = 0

Pointer's horizontal distance from the top left corner.

offsetY: number = 0

Pointer's vertical distance from the top left corner.

onStencilChanged?: ((stencilEditor) => void)

Type declaration

    • (stencilEditor): void
    • Fired when stencil changes.

      Parameters

      Returns void

onStencilCreated?: ((stencilEditor) => void)

Type declaration

    • (stencilEditor): void
    • Fired when stencil is created.

      Parameters

      Returns void

portConnectors: Map<PortLocation, PortConnector> = ...

Collection of ports.

resizeGrips: Map<GripLocation, ResizeGrip> = ...

Resize grips.

Panel for the text-related editor properties.

Accessors

  • get container(): SVGGElement
  • Returns the SVG container for the stencil's and editor's visual elements.

    Returns SVGGElement

  • get isFocused(): boolean
  • Returns true if the stencil is in focus.

    Returns boolean

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

    Returns boolean

  • get overlayContainer(): HTMLDivElement
  • Overlay container for HTML elements like text editors, etc.

    Returns HTMLDivElement

  • get settings(): EditorSettings
  • Editor settings and contextual settings manager.

    Returns EditorSettings

Methods

  • Creates a stencil at specified location.

    Parameters

    • point: IPoint

      location at which to create the stencil.

    Returns void

  • Handles a double-click event.

    Parameters

    • point: IPoint

      pointer location.

    • Optional target: EventTarget

      pointer event target.

    Returns void

  • Returns a port under the current pointer.

    Parameters

    • ev: null | PointerEvent

      pointer event.

    • exact: boolean = true

      if true, returns the port exactly under the pointer, otherwise - closest.

    • zoomLevel: number = 1

      current zoom level.

    Returns undefined | PortConnector

    target port.

  • Moves the stencil to specified location.

    Parameters

    • Optional x: number

      horizontal location.

    • Optional y: number

      vertical location.

    Returns void

  • Returns true if the element belongs to the stencil or the editor.

    Parameters

    • el: null | EventTarget

      target element.

    Returns boolean

    true if the element belongs to the stencil or editor.

  • Handles a pointerdown event.

    Parameters

    • point: IPoint

      pointer location.

    • Optional target: EventTarget

      event target element.

    Returns void

  • Scales the editor and stencil.

    Parameters

    • scaleX: number

      horizontal scale factor.

    • scaleY: number

      vertical scale factor.

    Returns void

Generated using TypeDoc