Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DiagramElement<M>

Type parameters

Hierarchy

Index

Constructors

constructor

Properties

Private _cursor

_cursor: Cursor = "default"

Private _hovered

_hovered: boolean = false

Private _modelElement

_modelElement: M

Private _ownedElements

_ownedElements: Array<DiagramElement<any>> = []

Private _owningElement

_owningElement: DiagramElement<any> | null = null

Private _selected

_selected: boolean = false

Static defaultMaxListeners

defaultMaxListeners: number

Accessors

bounds

contents

cursor

hovered

  • get hovered(): boolean

modelElement

  • get modelElement(): M
  • set modelElement(m: M): void

ownedElements

owningElement

selected

  • get selected(): boolean

topLeft

Methods

addListener

  • addListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

appendChild

  • appendChild(child: Element): void

calcAllElementBounds

  • calcAllElementBounds(): Bounds

containsPoint

  • containsPoint(px: number, py: number): boolean
  • Checks whether this element contains a given point

    Parameters

    • px: number

      X coordinate of the point to check

    • py: number

      Y coordinate of the point to check

    Returns boolean

createHandles

deselect

  • deselect(): void

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): (string | symbol)[]
  • Returns ( string | symbol ) []

getElementAtPosition

getHref

  • getHref(): string | undefined

getID

  • getID(): string | undefined

getMaxListeners

  • getMaxListeners(): number
  • Returns number

getOrigin

  • getOrigin(): string | undefined

getTypeName

  • getTypeName(): string | undefined

getTypeURI

  • getTypeURI(): string | undefined

hover

  • hover(val: boolean): void

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

merge

move

  • move(dx: number, dy: number): void

on

  • on(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

onKeyPress

onMouseLeave

onMouseMove

  • Called when the mouse is moved over the element

    Parameters

    • x: number

      X position on element

    • y: number

      Y position on element

    • i: InteractiveCanvas

      The interactive canvas which is accepting drawing commands

    Returns void

onTick

  • Called when a key is pressed on the element

    Parameters

    • time: number

      An integer representing the clock

    • i: InteractiveCanvas

      The interactive canvas which is accepting drawing commands

    Returns void

once

  • once(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeChild

  • removeChild(child: Element): boolean

removeListener

  • removeListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

render

  • render(canvas: Canvas): void

select

  • select(): void

setID

  • setID(ID: string | undefined): void

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

setOrigin

  • setOrigin(origin: string): void

setTypeName

  • setTypeName(name: string | undefined): void

setTypeURI

  • setTypeURI(uri: string | undefined): void

toString

  • toString(): string

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc