PageRenderTime 18ms CodeModel.GetById 13ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/src/org/mt4j/input/inputProcessors/componentProcessors/dragProcessor/DragEvent.java

http://mt4j.googlecode.com/
Java | 103 lines | 31 code | 17 blank | 55 comment | 0 complexity | cbf25eb59a8b256499d488f773fbcd1c 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.componentProcessors.dragProcessor;
 19
 20import org.mt4j.components.interfaces.IMTComponent3D;
 21import org.mt4j.input.inputData.InputCursor;
 22import org.mt4j.input.inputProcessors.IInputProcessor;
 23import org.mt4j.input.inputProcessors.MTGestureEvent;
 24import org.mt4j.util.math.Vector3D;
 25
 26
 27/**
 28 * The Class DragEvent.
 29 * @author Christopher Ruff
 30 */
 31public class DragEvent extends MTGestureEvent {
 32	
 33	/** The drag cursor. */
 34	private InputCursor dragCursor;
 35	
 36	/** The from. */
 37	private Vector3D from;
 38	
 39	/** The to. */
 40	private Vector3D to;
 41	
 42	/** The translation vect. */
 43	private Vector3D translationVect;
 44	
 45	
 46	/**
 47	 * Instantiates a new drag event.
 48	 * 
 49	 * @param source the source
 50	 * @param id the id
 51	 * @param targetComponent the target component
 52	 * @param dragCursor the drag cursor
 53	 * @param from the from
 54	 * @param to the to
 55	 */
 56	public DragEvent(IInputProcessor source, int id, IMTComponent3D targetComponent, InputCursor dragCursor, Vector3D from, Vector3D to) {
 57		super(source, id, targetComponent);
 58		this.dragCursor = dragCursor;
 59		this.from = from;
 60		this.to = to;
 61		this.translationVect = to.getSubtracted(from);
 62	}
 63
 64	/**
 65	 * Gets the drag cursor.
 66	 * 
 67	 * @return the drag cursor
 68	 */
 69	public InputCursor getDragCursor() {
 70		return dragCursor;
 71	}
 72
 73	/**
 74	 * Gets the from.
 75	 * 
 76	 * @return the from
 77	 */
 78	public Vector3D getFrom() {
 79		return from;
 80	}
 81
 82	/**
 83	 * Gets the to.
 84	 * 
 85	 * @return the to
 86	 */
 87	public Vector3D getTo() {
 88		return to;
 89	}
 90
 91	/**
 92	 * Gets the translation vect.
 93	 * 
 94	 * @return the translation vect
 95	 */
 96	public Vector3D getTranslationVect() {
 97		return translationVect;
 98	}
 99
100	
101
102
103}