Home Reference Source
import GlCable from './ui/glpatch/glcable.js'
public class | source

GlCable

rendering cables for links

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

LINETYPE_CURVED: number

public
public

LINETYPE_SIMPLE: number

public
public get
public get
public set
Private Members
private
private
private

_curvedSimple: boolean

private

_disposed: boolean

private

_distFromPort: number

private
private
private

_link: *

private
private

_log: *

private

_oldx: *

private

_oldx2: *

private

_oldy2: *

private

_points: *[]

private
private
private
private

_tension: number

private

_type: *

private

_visible: boolean

private

_x: number

private

_x2: number

private

_y: number

private

_y2: number

Method Summary

Public Methods
public

collideLine(x1: *, y1: *, x2: *, y2: *): boolean

public

collideLineLine(x1: *, y1: *, x2: *, y2: *, x3: *, y3: *, x4: *, y4: *): boolean

public

collideMouse(e: *, x1: *, y1: *, x2: *, y2: *, cx: *, cy: *, r: *): boolean

public
public
public
public

setColor(r: *, g: *, b: *, a: *)

public

setPosition(x: *, y: *, x2: *, y2: *)

public

setSpeed(speed: *)

public

setText(t: *)

public
public
public
public
Private Methods
private

_checkCollide(e: *): boolean

private

_collideLinePoint(x1: *, y1: *, x2: *, y2: *, px: *, py: *): boolean

private

_collidePointCircle(px: *, py: *, cx: *, cy: *, r: *): boolean

private

_dist(x: *, y: *, x2: *, y2: *): *

private
private

_subdivide(inPoints: *, divs: *): *

private
private
private

Public Constructors

public constructor() source

Public Members

public LINETYPE_CURVED: number source

public LINETYPE_HANGING: number source

public LINETYPE_SIMPLE: number source

public LINETYPE_STRAIGHT: number source

public get hovering: * source

public get subPatch: * source

public set visible source

Private Members

private _buttonRect: * source

private _buttonSize: * source

private _curvedSimple: boolean source

private _disposed: boolean source

private _distFromPort: number source

private _glPatch: * source

private _linetype: * source

private _listenerMousemove: * source

private _log: * source

private _oldx: * source

private _oldx2: * source

private _oldy2: * source

private _points: *[] source

private _splineDrawer: * source

private _splineIdx: * source

private _subPatch: * source

private _tension: number source

private _type: * source

private _visible: boolean source

private _x: number source

private _x2: number source

private _y: number source

private _y2: number source

Public Methods

public collideLine(x1: *, y1: *, x2: *, y2: *): boolean source

Params:

NameTypeAttributeDescription
x1 *
y1 *
x2 *
y2 *

Return:

boolean

public collideLineLine(x1: *, y1: *, x2: *, y2: *, x3: *, y3: *, x4: *, y4: *): boolean source

Params:

NameTypeAttributeDescription
x1 *
y1 *
x2 *
y2 *
x3 *
y3 *
x4 *
y4 *

Return:

boolean

public collideMouse(e: *, x1: *, y1: *, x2: *, y2: *, cx: *, cy: *, r: *): boolean source

Params:

NameTypeAttributeDescription
e *
x1 *
y1 *
x2 *
y2 *
cx *
cy *
r *

Return:

boolean

public dispose() source

public isHoveredButtonRect(): * source

Return:

*

public setCloseToMouse(b: *) source

Params:

NameTypeAttributeDescription
b *

public setColor(r: *, g: *, b: *, a: *) source

Params:

NameTypeAttributeDescription
r *
g *
b *
a *

public setPosition(x: *, y: *, x2: *, y2: *) source

Params:

NameTypeAttributeDescription
x *
y *
x2 *
y2 *

public setSpeed(speed: *) source

Params:

NameTypeAttributeDescription
speed *

public setText(t: *) source

Params:

NameTypeAttributeDescription
t *

public updateColor() source

public updateLineStyle() source

public updateMouseListener() source

public updateVisible() source

Private Methods

private _checkCollide(e: *): boolean source

Params:

NameTypeAttributeDescription
e *

Return:

boolean

private _collideLinePoint(x1: *, y1: *, x2: *, y2: *, px: *, py: *): boolean source

Params:

NameTypeAttributeDescription
x1 *
y1 *
x2 *
y2 *
px *
py *

Return:

boolean

private _collidePointCircle(px: *, py: *, cx: *, cy: *, r: *): boolean source

Params:

NameTypeAttributeDescription
px *
py *
cx *
cy *
r *

Return:

boolean

private _dist(x: *, y: *, x2: *, y2: *): * source

Params:

NameTypeAttributeDescription
x *
y *
x2 *
y2 *

Return:

*

private _setPositionButton() source

private _subdivide(inPoints: *, divs: *): * source

Params:

NameTypeAttributeDescription
inPoints *
divs *

Return:

*

private _unHover() source

private _updateDistFromPort() source

private _updateLinePos() source