twaver.network.interaction
Class CreateShapeInteraction

java.lang.Object
  extended by twaver.network.interaction.Interaction
      extended by twaver.network.interaction.CreateShapeInteraction
All Implemented Interfaces:
Action2<Canvas,Paint>, IInteraction

public class CreateShapeInteraction
extends Interaction
implements Action2<Canvas,Paint>

创建多边形交互,用于创建 ShapeNode网元类型


Field Summary
protected  int fillColor
           
protected  Path path
           
protected  java.util.List<Point> points
          当前拐点集合
protected  int strokeColor
           
 
Fields inherited from class twaver.network.interaction.Interaction
network
 
Constructor Summary
CreateShapeInteraction(Network network)
          构造函数,创建多边形交互,用于创建 ShapeNode网元类型
 
Method Summary
 boolean action(Canvas canvas, Paint paint)
          执行函数
 void destroy()
          结束交互
 boolean onDoubleTap(TouchEvent e)
          双击
 boolean onSingleTapConfirmed(TouchEvent e)
          单指点击事件
 
Methods inherited from class twaver.network.interaction.Interaction
onDown, onFling, onLongPress, onMove, onScale, onScaleBegin, onScaleEnd, onScroll, onSingleTapUp, onUp, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

points

protected java.util.List<Point> points
当前拐点集合


path

protected Path path

strokeColor

protected int strokeColor

fillColor

protected int fillColor
Constructor Detail

CreateShapeInteraction

public CreateShapeInteraction(Network network)
构造函数,创建多边形交互,用于创建 ShapeNode网元类型

Parameters:
network - 拓扑图
Method Detail

onSingleTapConfirmed

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

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

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:
是否处理

destroy

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

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

action

public boolean action(Canvas canvas,
                      Paint paint)
Description copied from interface: Action2
执行函数

Specified by:
action in interface Action2<Canvas,Paint>
Parameters:
canvas - 输入参数
paint - 输入参数
Returns:
通常可以通过返回值表示是否执行成功