this.toolEventListener = (NodePressAndDraggingEventListener) toolListener;
}
public void select() {
currentListeners = new VizEventListener[3];
currentListeners[0] = new VizEventListener() {
public void handleEvent(VizEvent event) {
toolEventListener.pressNodes((Node[]) event.getData());
}
public Type getType() {
return VizEvent.Type.NODE_LEFT_PRESS;
}
};
currentListeners[1] = new VizEventListener() {
public void handleEvent(VizEvent event) {
float[] mouseDrag = (float[]) event.getData();
toolEventListener.drag(mouseDrag[0], mouseDrag[1]);
}
public Type getType() {
return VizEvent.Type.DRAG;
}
};
currentListeners[2] = new VizEventListener() {
public void handleEvent(VizEvent event) {
toolEventListener.released();
}