Class: SelectedGroup
当前选中的对象组(由鼠标点击 或者 框选)
js
// 当前被选中的对象集合,有Node、Link
let objects = stage.selectedGroup.objects;
Hierarchy
↳
SelectedGroup
Table of contents
Constructors
Properties
Methods
- add
- addAll
- addEventListener
- dispatchEvent
- dragEndHandler
- dragHandler
- getNoChildrensObjects
- has
- hasListener
- isEmpty
- mouseoutHandler
- on
- remove
- removeAll
- removeEventListener
Constructors
constructor
new SelectedGroup()
Overrides
Properties
isDraging
isDraging: boolean
= false
objects
objects: any
[] = []
当前被选中的对象集合,有Node、Link
Methods
add
add(child
): SelectedGroup
Parameters
Name | Type |
---|---|
child | any |
Returns
addAll
addAll(childs
): SelectedGroup
Parameters
Name | Type |
---|---|
childs | any |
Returns
addEventListener
addEventListener(type
, callback
): void
增加事件监听
Parameters
Name | Type | Description |
---|---|---|
type | string | 事件类型 |
callback | Function |
Returns
void
Inherited from
dispatchEvent
dispatchEvent(event
): void
分发事件
Parameters
Name | Type |
---|---|
event | any |
Returns
void
Inherited from
dragEndHandler
dragEndHandler(inputSystem
): void
Parameters
Name | Type |
---|---|
inputSystem | InputSystem |
Returns
void
dragHandler
dragHandler(inputSystem
): void
Parameters
Name | Type |
---|---|
inputSystem | InputSystem |
Returns
void
getNoChildrensObjects
getNoChildrensObjects(): DisplayObject
[]
Returns
has
has(child
): boolean
Parameters
Name | Type |
---|---|
child | any |
Returns
boolean
hasListener
hasListener(type
): boolean
是否有该类型的监听
Parameters
Name | Type |
---|---|
type | string |
Returns
boolean
Inherited from
isEmpty
isEmpty(): boolean
Returns
boolean
mouseoutHandler
mouseoutHandler(inputSystem
): void
Parameters
Name | Type |
---|---|
inputSystem | InputSystem |
Returns
void
on
on(type
, callback
): void
增加监听事件, 功能完全等同于addEventListener,一种简写
Parameters
Name | Type | Description |
---|---|---|
type | string | 事件类型 |
callback | Function | 事件处理函数 |
Returns
void
Inherited from
remove
remove(child
): SelectedGroup
Parameters
Name | Type |
---|---|
child | any |
Returns
removeAll
removeAll(): SelectedGroup
Returns
removeEventListener
removeEventListener(type
, callback
): any
移除一个事件监听
Parameters
Name | Type |
---|---|
type | string |
callback | Function |
Returns
any