twaver.network.interaction
Class CreateLinkInteraction

java.lang.Object
  extended by twaver.network.interaction.Interaction
      extended by twaver.network.interaction.SingleTouchDragInteraction
          extended by twaver.network.interaction.CreateLinkInteraction
All Implemented Interfaces:
IInteraction

public class CreateLinkInteraction
extends SingleTouchDragInteraction

创建连线交互


Field Summary
 
Fields inherited from class twaver.network.interaction.SingleTouchDragInteraction
stopWhenMultiTouch
 
Fields inherited from class twaver.network.interaction.Interaction
network
 
Constructor Summary
CreateLinkInteraction(Network network)
          构造函数,创建连线交互
 
Method Summary
 void destroy()
          结束交互
protected  boolean doDragging(TouchEvent e1, TouchEvent e2, float distanceX, float distanceY)
          拖拽操作中
protected  void endDrag(TouchEvent event)
          结束拖拽
 boolean onDoubleTap(TouchEvent e)
          双击
 void reset()
          重置拖拽状态
protected  boolean startDrag(TouchEvent e1, TouchEvent event, float distanceX, float distanceY)
          开始拖拽
 
Methods inherited from class twaver.network.interaction.SingleTouchDragInteraction
onDown, onScroll, onUp, stop
 
Methods inherited from class twaver.network.interaction.Interaction
onFling, onLongPress, onMove, onScale, onScaleBegin, onScaleEnd, onSingleTapConfirmed, onSingleTapUp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreateLinkInteraction

public CreateLinkInteraction(Network network)
构造函数,创建连线交互

Parameters:
network - 拓扑图
Method Detail

destroy

public void destroy()
Description copied from interface: IInteraction
结束交互

Specified by:
destroy in interface IInteraction
Overrides:
destroy in class SingleTouchDragInteraction

reset

public void reset()
Description copied from class: SingleTouchDragInteraction
重置拖拽状态

Overrides:
reset in class SingleTouchDragInteraction

startDrag

protected boolean startDrag(TouchEvent e1,
                            TouchEvent event,
                            float distanceX,
                            float distanceY)
Description copied from class: SingleTouchDragInteraction
开始拖拽

Specified by:
startDrag in class SingleTouchDragInteraction
Parameters:
e1 - 开始拖拽事件
event - 当前触摸事件
distanceX - 拖拽距离
distanceY - 拖拽距离
Returns:
是否允许拖拽操作

doDragging

protected boolean doDragging(TouchEvent e1,
                             TouchEvent e2,
                             float distanceX,
                             float distanceY)
Description copied from class: SingleTouchDragInteraction
拖拽操作中

Specified by:
doDragging in class SingleTouchDragInteraction
Parameters:
e1 - 开始拖拽事件
e2 - 当前触摸事件
distanceX - 拖拽距离
distanceY - 拖拽距离
Returns:
是否执行操作

endDrag

protected void endDrag(TouchEvent event)
Description copied from class: SingleTouchDragInteraction
结束拖拽

Specified by:
endDrag in class SingleTouchDragInteraction
Parameters:
event - 当前触摸事件

onDoubleTap

public boolean onDoubleTap(TouchEvent e)
Description copied from interface: IInteraction
双击

Specified by:
onDoubleTap in interface IInteraction
Overrides:
onDoubleTap in class Interaction
Parameters:
e - 触摸事件
Returns:
是否处理