Class: EndpointFixedPoint
端点: 固定的一个坐标值
js
import {EndpointFixedPoint} from '@jtopo/core';
// 示例
let endpoint = new EndpointFixedPoint(12, 20);
link.setBegin(endpoint);
等价于:
link.setBegin({x:12, y:20});
// node的右上角
let endpoint = new EndpointFixedPoint(node.width/2, -node.height/2, fromNode);
// node的中心
let endpoint = new EndpointFixedPoint(0, 0, fromNode);
// node的左下角
let endpoint = new EndpointFixedPoint(-node.width/2, node.height/2, 0, fromNode);
Hierarchy
↳
EndpointFixedPoint
Table of contents
Constructors
Properties
Methods
Constructors
constructor
new EndpointFixedPoint(x
, y
, target?
)
如果指定了target对象,x,y 在target对象的本地坐标系。
如果target为null, x,y 在link父对象的本地坐标系。
Parameters
Name | Type |
---|---|
x | number |
y | number |
target? | DisplayObject |
Overrides
Properties
className
className: string
Overrides
target
Optional
target: DisplayObject
被连接的对象, 可能为空
Inherited from
x
x: number
y
y: number
Methods
hasTarget
hasTarget(): boolean
Returns
boolean
Inherited from
isDisplayObjectTarget
isDisplayObjectTarget(): boolean
Returns
boolean
Inherited from
Endpoint.isDisplayObjectTarget
isNodeTarget
isNodeTarget(): any
Returns
any
Inherited from
toJSON
toJSON(objIndexMap?
): any
Parameters
Name | Type |
---|---|
objIndexMap? | Map <DisplayObject , number > |
Returns
any
Inherited from
fromJSON
Static
fromJSON(json
, objIndexMap?
): any
Parameters
Name | Type |
---|---|
json | any |
objIndexMap? | Object |
Returns
any