new TouchInteractor(graphView, params)
实现触摸屏上Touch交互
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
graphView |
ht.graph.GraphView | 绑定拓扑组件 |
|
params |
any |
<optional> |
交互参数 |
Example
//params参数格式:
{
selectable: true|false,//是否启用选择功能
movable: true|false,//是否启用移动功能
pannable: true|false,//是否启用pan功能
pinchable: true|false,//是否启用双指pinch缩放
editable: true|false,//是否启用编辑功能
}
Extends
Members
-
_graphView :ht.graph.GraphView
-
拓扑组件
- Inherited From:
-
gv :ht.graph.GraphView
-
拓扑组件
- Inherited From:
Methods
-
addListeners() → {void}
-
添加事件监听
交互器遍历自身的 handle_xxx 函数,如果发现 xxx 匹配某种事件类型,会增加相应的事件监听
例如:
handle_keydown keydown 事件处理函数Returns:
void- Inherited From:
-
autoScroll(event) → {void}
-
Parameters:
Name Type Attributes Description event
UIEvent <optional>
Returns:
void- Inherited From:
-
clear() → {void}
-
默认为空函数,在 tearDown 中执行
Returns:
void- Inherited From:
-
clearDragging() → {void}
-
清除拖拽
Returns:
void- Inherited From:
-
fi(event) → {void}
-
派发交互器事件
Parameters:
Name Type Description event
any Returns:
void- Inherited From:
-
getClass() → {function}
-
获取类声明(构造函数)
Returns:
function- Inherited From:
-
getClassName() → {string}
-
获取类全名
Returns:
string- Inherited From:
-
getSuperClass() → {function}
-
获取父类声明(构造函数),继承类时可以用来调用父类构造或函数
Returns:
function -父类声明(构造函数)
- Inherited From:
-
getView() → {HTMLDivElement}
-
获取拓扑组件的根层div
Returns:
HTMLDivElement- Inherited From:
-
removeListeners() → {void}
-
移除事件监听
Returns:
void- Inherited From:
-
setCursor(cursor) → {void}
-
设置鼠标样式
Parameters:
Name Type Description cursor
string Returns:
void- Inherited From:
-
setUp() → {void}
-
安装函数
Returns:
void- Inherited From:
-
startDragging(event) → {void}
-
启动拖拽
Parameters:
Name Type Description event
Event Returns:
void- Inherited From:
-
tearDown() → {void}
-
卸载函数
Returns:
void- Inherited From: