twaver.network.interaction
Class PointsInteraction

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

public class PointsInteraction
extends SingleTouchDragInteraction

路径片段编辑交互


Field Summary
 
Fields inherited from class twaver.network.interaction.SingleTouchDragInteraction
stopWhenMultiTouch
 
Fields inherited from class twaver.network.interaction.Interaction
network
 
Constructor Summary
PointsInteraction(Network network)
          构造函数,路径片段编辑交互
 
Method Summary
 void destroy()
          结束交互
protected  boolean doDragging(TouchEvent e1, TouchEvent event, float distanceX, float distanceY)
          拖拽操作中
protected  void endDrag(TouchEvent event)
          结束拖拽
 boolean onDoubleTap(TouchEvent evt)
          双击
 void onLongPress(TouchEvent e)
          长按
 boolean onSingleTapConfirmed(TouchEvent evt)
          单指点击事件
 boolean onUp(TouchEvent event)
          释放
 void reset()
          重置拖拽状态
protected  boolean startDrag(TouchEvent e1, TouchEvent event, float distanceX, float distanceY)
          开始拖拽
 void stop()
          停止拖拽,默认与重置拖拽状态相同 SingleTouchDragInteraction.reset()
 
Methods inherited from class twaver.network.interaction.SingleTouchDragInteraction
onDown, onScroll
 
Methods inherited from class twaver.network.interaction.Interaction
onFling, onMove, onScale, onScaleBegin, onScaleEnd, onSingleTapUp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PointsInteraction

public PointsInteraction(Network network)
构造函数,路径片段编辑交互

Parameters:
network - 拓扑图
Method Detail

onLongPress

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

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

onDoubleTap

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

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

onSingleTapConfirmed

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

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

stop

public void stop()
Description copied from class: SingleTouchDragInteraction
停止拖拽,默认与重置拖拽状态相同 SingleTouchDragInteraction.reset()

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

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

onUp

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

Specified by:
onUp in interface IInteraction
Overrides:
onUp in class SingleTouchDragInteraction
Parameters:
event - 触摸事件
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