PageRenderTime 13ms CodeModel.GetById 1ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 1ms

/src/org/mt4j/input/inputProcessors/MTGestureEvent.java

http://mt4j.googlecode.com/
Java | 109 lines | 27 code | 24 blank | 58 comment | 0 complexity | 5fd7a7feb4954732ae71267fe86ebea5 MD5 | raw file
  1/***********************************************************************
  2 * mt4j Copyright (c) 2008 - 2009, C.Ruff, Fraunhofer-Gesellschaft All rights reserved.
  3 *  
  4 *   This program is free software: you can redistribute it and/or modify
  5 *   it under the terms of the GNU General Public License as published by
  6 *   the Free Software Foundation, either version 3 of the License, or
  7 *   (at your option) any later version.
  8 *
  9 *   This program is distributed in the hope that it will be useful,
 10 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 11 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 12 *   GNU General Public License for more details.
 13 *
 14 *   You should have received a copy of the GNU General Public License
 15 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 16 *
 17 ***********************************************************************/
 18package org.mt4j.input.inputProcessors;
 19
 20import org.mt4j.components.interfaces.IMTComponent3D;
 21import org.mt4j.input.inputData.MTInputEvent;
 22
 23
 24
 25/**
 26 * The Class GestureEvent.
 27 * @author Christopher Ruff
 28 */
 29public abstract class MTGestureEvent extends MTInputEvent {
 30	
 31	/** The id. */
 32	private int id;
 33	
 34	/**
 35	 The Constant GESTURE_DETECTED.
 36	@deprecated use GESTURE_STARTED instead */
 37	public static final int GESTURE_DETECTED 	= 0;
 38	
 39	/** The Constant GESTURE_STARTED. */
 40	public static final int GESTURE_STARTED 	= 0;
 41	
 42	/** The Constant GESTURE_UPDATED. */
 43	public static final int GESTURE_UPDATED 	= 1;
 44	
 45	/** The Constant GESTURE_ENDED. */
 46	public static final int GESTURE_ENDED		= 2;
 47	
 48	
 49	/** The Constant GESTURE_CANCELED. 
 50	 * Used when the gesture/input processing is aborted.
 51	 * It is not guaranteed atm that GESTURE_ENDED will be called in the future.
 52	 * */
 53	public static final int GESTURE_CANCELED	= 3;
 54	
 55	
 56	/** The Constant GESTURE_RESUMED. 
 57	 * Used when a gesture is resumed because it has the highest priority again for example.
 58	 * */
 59	public static final int GESTURE_RESUMED		= 4;
 60	
 61	/**
 62	 * Instantiates a new gesture event.
 63	 * 
 64	 * @param source the source
 65	 * @param id the id
 66	 * @param targetComponent the target component
 67	 */
 68	public MTGestureEvent(IInputProcessor source, int id, IMTComponent3D targetComponent) {
 69		super(source, targetComponent, false);
 70		this.id = id;
 71		this.setCurrentTarget(targetComponent); //test ..
 72	}
 73	
 74	
 75	
 76
 77	@Override
 78	public IInputProcessor getSource() {
 79		return (IInputProcessor)super.getSource();
 80	}
 81
 82
 83	/**
 84	 * Gets the id.
 85	 * <br>Can be a value of:
 86	 * <ul>
 87	 * <li>GESTURE_DETECTED
 88	 * <li>GESTURE_UPDATED
 89	 * <li>GESTURE_ENDED
 90	 * </ul>
 91	 * 
 92	 * @return the id
 93	 */
 94	public int getId() {
 95		return id;
 96	}
 97
 98
 99	/**
100	 * Sets the id.
101	 * 
102	 * @param id the new id
103	 */
104	public void setId(int id) {
105		this.id = id;
106	}
107
108
109}