twaver.network.interaction
Class RectangleSelectionInteraction

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

public class RectangleSelectionInteraction
extends SingleTouchDragInteraction

框选交互


Field Summary
 
Fields inherited from class twaver.network.interaction.SingleTouchDragInteraction
stopWhenMultiTouch
 
Fields inherited from class twaver.network.interaction.Interaction
network
 
Constructor Summary
RectangleSelectionInteraction(Network network)
          构造函数,框选交互
 
Method Summary
 void destroy()
          结束交互
protected  boolean doDragging(TouchEvent e1, TouchEvent event, float distanceX, float distanceY)
          拖拽操作中
protected  void endDrag(TouchEvent event)
          结束拖拽
 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
onDoubleTap, 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

RectangleSelectionInteraction

public RectangleSelectionInteraction(Network network)
构造函数,框选交互

Parameters:
network - 拓扑图
Method Detail

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 event,
                             float distanceX,
                             float distanceY)
Description copied from class: SingleTouchDragInteraction
拖拽操作中

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

endDrag

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

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

reset

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

Overrides:
reset in class SingleTouchDragInteraction

destroy

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

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