Appearance
@jtopo/core / AnchorProxy
Class: AnchorProxy
AnchorProxy 是 Anchor类的代理,用于计算锚点在宿主对象上的位置
Table of contents
Constructors
Properties
Methods
- equals
- hasHost
- isDisplayObjectHost
- isNodeHost
- toJSON
- toPoint
- calcPointByAnchor
- getAutoPointOnLink
- getOnLinkPoint
- getPointOnLinkHost
- getPointOnNodeHost
- toLinkLocalPoint
Constructors
constructor
new AnchorProxy(anchor, host?)
Parameters
| Name | Type |
|---|---|
anchor | Anchor |
host? | Node | Link |
Properties
anchor
anchor: Anchor
锚点
host
宿主对象
Methods
equals
equals(other): boolean
Parameters
| Name | Type |
|---|---|
other | AnchorProxy |
Returns
boolean
hasHost
hasHost(): boolean
Returns
boolean
isDisplayObjectHost
isDisplayObjectHost(): boolean
Returns
boolean
isNodeHost
isNodeHost(): boolean
Returns
boolean
toJSON
toJSON(objIndexMap?): any
Parameters
| Name | Type |
|---|---|
objIndexMap? | Map<NE, number> |
Returns
any
toPoint
toPoint(): PointLike
计算并转换为点
Returns
calcPointByAnchor
Static calcPointByAnchor(host, anchor): PointLike
Parameters
| Name | Type |
|---|---|
host | Node | Link |
anchor | Anchor |
Returns
getAutoPointOnLink
Static getAutoPointOnLink(link, anchorProxy, otherAnchorProxy): PointLike
Parameters
| Name | Type |
|---|---|
link | Link |
anchorProxy | AnchorProxy |
otherAnchorProxy | AnchorProxy |
Returns
getOnLinkPoint
Static getOnLinkPoint(link, anchorProxy): PointLike
Parameters
| Name | Type |
|---|---|
link | Link |
anchorProxy | AnchorProxy |
Returns
getPointOnLinkHost
Static getPointOnLinkHost(hostLink, anchor): PointLike
Parameters
| Name | Type |
|---|---|
hostLink | Link |
anchor | Anchor |
Returns
getPointOnNodeHost
Static getPointOnNodeHost(hostNode, anchor): PointLike
Parameters
| Name | Type |
|---|---|
hostNode | Node |
anchor | Anchor |
Returns
toLinkLocalPoint
Static toLinkLocalPoint(link, host, pointInHostLocal): PointLike
Parameters
| Name | Type |
|---|---|
link | Link |
host | Node | Link |
pointInHostLocal | PointLike |