Skip to content
本页目录

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

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new EndpointFixedPoint(x, y, target?)

如果指定了target对象,x,y 在target对象的本地坐标系。

如果target为null, x,y 在link父对象的本地坐标系。

Parameters

NameType
xnumber
ynumber
target?DisplayObject

Overrides

Endpoint.constructor

Properties

className

className: string

Overrides

Endpoint.className


target

Optional target: DisplayObject

被连接的对象, 可能为空

Inherited from

Endpoint.target


x

x: number


y

y: number

Methods

hasTarget

hasTarget(): boolean

Returns

boolean


isDisplayObjectTarget

isDisplayObjectTarget(): boolean

Returns

boolean

Inherited from

Endpoint.isDisplayObjectTarget


isNodeTarget

isNodeTarget(): any

Returns

any

Inherited from

Endpoint.isNodeTarget


toJSON

toJSON(): { className: string } & EndpointFixedPoint

Returns

{ className: string } & EndpointFixedPoint

Inherited from

Endpoint.toJSON