twaver.network.interaction
Class Interaction

java.lang.Object
  extended by twaver.network.interaction.Interaction
All Implemented Interfaces:
IInteraction
Direct Known Subclasses:
CreateShapeInteraction, DoubleTabInteraction, PanInteraction, SelectionInteraction, SingleTouchDragInteraction, ZoomInteraction

public class Interaction
extends java.lang.Object
implements IInteraction

交互监听器 IInteraction实现类


Field Summary
protected  Network network
          拓扑图
 
Constructor Summary
Interaction(Network network)
          构造函数
 
Method Summary
 void destroy()
          结束交互
 boolean onDoubleTap(TouchEvent e)
          双击
 boolean onDown(TouchEvent e)
          按下
 boolean onFling(TouchEvent e1, TouchEvent e2, float velocityX, float velocityY)
          快速滑动
 void onLongPress(TouchEvent e)
          长按
 boolean onMove(MotionEvent event)
           
 boolean onScale(ScaleGestureDetector detector)
          缩放事件
 boolean onScaleBegin(ScaleGestureDetector detector)
          缩放事件开始
 void onScaleEnd(ScaleGestureDetector detector)
          缩放事件结束
 boolean onScroll(TouchEvent e1, TouchEvent e2, float distanceX, float distanceY)
          滑动
 boolean onSingleTapConfirmed(TouchEvent e)
          单指点击事件
 boolean onSingleTapUp(TouchEvent e)
          单点触摸释放
 boolean onUp(TouchEvent e)
          释放
 void reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

network

protected Network network
拓扑图

Constructor Detail

Interaction

public Interaction(Network network)
构造函数

Parameters:
network - 拓扑图
Method Detail

reset

public void reset()

onDown

public boolean onDown(TouchEvent e)
Description copied from interface: IInteraction
按下

Specified by:
onDown in interface IInteraction
Parameters:
e - 触摸事件
Returns:
是否处理

onUp

public boolean onUp(TouchEvent e)
Description copied from interface: IInteraction
释放

Specified by:
onUp in interface IInteraction
Parameters:
e - 触摸事件
Returns:
是否处理

onSingleTapUp

public boolean onSingleTapUp(TouchEvent e)
Description copied from interface: IInteraction
单点触摸释放

Specified by:
onSingleTapUp in interface IInteraction
Parameters:
e - 触摸事件
Returns:
是否处理

onScroll

public boolean onScroll(TouchEvent e1,
                        TouchEvent e2,
                        float distanceX,
                        float distanceY)
Description copied from interface: IInteraction
滑动

Specified by:
onScroll in interface IInteraction
Parameters:
e1 - 初始按下事件
e2 - 当前触摸事件
distanceX - 滑动距离
distanceY - 滑动距离
Returns:
是否处理

onMove

public boolean onMove(MotionEvent event)

onLongPress

public void onLongPress(TouchEvent e)
Description copied from interface: IInteraction
长按

Specified by:
onLongPress in interface IInteraction
Parameters:
e - 触摸事件

onFling

public boolean onFling(TouchEvent e1,
                       TouchEvent e2,
                       float velocityX,
                       float velocityY)
Description copied from interface: IInteraction
快速滑动

Specified by:
onFling in interface IInteraction
Parameters:
e1 - 初始按下事件
e2 - 当前触摸事件
velocityX - 滑动速率
velocityY - 滑动速率
Returns:
是否处理

onSingleTapConfirmed

public boolean onSingleTapConfirmed(TouchEvent e)
Description copied from interface: IInteraction
单指点击事件

Specified by:
onSingleTapConfirmed in interface IInteraction
Parameters:
e - 触摸事件
Returns:
是否处理

onDoubleTap

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

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

onScale

public boolean onScale(ScaleGestureDetector detector)
Description copied from interface: IInteraction
缩放事件

Specified by:
onScale in interface IInteraction
Parameters:
detector - 缩放处理器
Returns:
是否处理

onScaleBegin

public boolean onScaleBegin(ScaleGestureDetector detector)
Description copied from interface: IInteraction
缩放事件开始

Specified by:
onScaleBegin in interface IInteraction
Parameters:
detector - 缩放处理器
Returns:
是否处理

onScaleEnd

public void onScaleEnd(ScaleGestureDetector detector)
Description copied from interface: IInteraction
缩放事件结束

Specified by:
onScaleEnd in interface IInteraction
Parameters:
detector - 缩放处理器

destroy

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

Specified by:
destroy in interface IInteraction