org.malai.interaction.library
Class MultiClick

java.lang.Object
  extended by org.malai.interaction.Interaction
      extended by org.malai.interaction.library.MultiClick
All Implemented Interfaces:
EventHandler, IStateMachine

public class MultiClick
extends Interaction

This interaction allows to performed several clicks using button 1. If a click occurs with another button, the interaction ends. THe interaction is aborted is key 'escape' is pressed.
This file is part of Malai.
Copyright (c) 2009-2012 Arnaud BLOUIN

Malai is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Malai is distributed without any warranty; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

05/19/2010

Since:
0.2
Author:
Arnaud BLOUIN

Field Summary
protected  java.awt.Point currentPosition
          The current position of the pointing device.
protected  int minPoints
          The minimum number of points that the interaction must gather.
protected  java.util.List<java.awt.Point> points
          The list of pressed position.
 
Fields inherited from class org.malai.interaction.Interaction
activated, currentState, currentTimeout, handlers, initState, lastHIDUsed, states, stillProcessingEvents
 
Constructor Summary
MultiClick()
          Creates the interaction.
 
Method Summary
 java.awt.Point getCurrentPosition()
           
 int getMinPoints()
           
 java.util.List<java.awt.Point> getPoints()
           
protected  void initStateMachine()
          Initialises the interaction: creates the states and the transitions.
 boolean isLastPointFinalPoint()
           
 void reinit()
          Reinits the state machine.
 void setMinPoints(int minPoints)
           
 
Methods inherited from class org.malai.interaction.Interaction
addEvent, addHandler, addState, checkTimeoutTransition, clearEventsStillInProcess, getHandlers, getLastHIDUsed, getPickableAt, isRunning, linkToEventable, notifyHandlersOnAborting, notifyHandlersOnStart, notifyHandlersOnStop, notifyHandlersOnUpdate, onAborting, onButtonPressed, onCheckBoxModified, onItemSelected, onKeyPressure, onKeyRelease, onMenuItemPressed, onMove, onPressure, onRelease, onScroll, onSpinnerChanged, onStarting, onTabChanged, onTerminating, onTextChanged, onTimeout, onUpdating, onWindowClosed, processEvents, removeKeyEvent, removePressEvent, setActivated, setLastHIDUsed, stopCurrentTimeout
 
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<java.awt.Point> points
The list of pressed position.


currentPosition

protected java.awt.Point currentPosition
The current position of the pointing device.


minPoints

protected int minPoints
The minimum number of points that the interaction must gather.

Constructor Detail

MultiClick

public MultiClick()
Creates the interaction.

Method Detail

reinit

public void reinit()
Description copied from interface: IStateMachine
Reinits the state machine.

Specified by:
reinit in interface IStateMachine
Overrides:
reinit in class Interaction

isLastPointFinalPoint

public boolean isLastPointFinalPoint()
Returns:
True if the last point gathered by the interaction is a point created by the right click that ends the interaction. This method is useful to make the difference between points created using left clicks and the last one created using a right click.
Since:
0.2

initStateMachine

protected void initStateMachine()
Description copied from class: Interaction
Initialises the interaction: creates the states and the transitions.

Specified by:
initStateMachine in class Interaction

getPoints

public java.util.List<java.awt.Point> getPoints()
Returns:
The list of pressed position.
Since:
0.2

getCurrentPosition

public java.awt.Point getCurrentPosition()
Returns:
The current position of the pointing device.
Since:
0.2

getMinPoints

public int getMinPoints()
Returns:
The minimum number of points that the interaction must gather.
Since:
0.2

setMinPoints

public void setMinPoints(int minPoints)
Parameters:
minPoints - The minimum number of points that the interaction must gather. Must be greater than 0.
Since:
0.2