PageRenderTime 59ms CodeModel.GetById 44ms app.highlight 10ms RepoModel.GetById 2ms app.codeStats 0ms

/src/org/mt4j/input/inputProcessors/componentProcessors/scaleProcessor/ScaleEvent.java

http://mt4j.googlecode.com/
Java | 194 lines | 62 code | 29 blank | 103 comment | 0 complexity | 22c2a8388b67508c894d6bf4d84a2688 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.scaleProcessor;
 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 ScaleEvent.
 29 * @author Christopher Ruff
 30 */
 31public class ScaleEvent extends MTGestureEvent{
 32	
 33	/** The scale factor x. */
 34	private float scaleFactorX;
 35	
 36	/** The scale factor y. */
 37	private float scaleFactorY;
 38	
 39	/** The scale factor z. */
 40	private float scaleFactorZ;
 41	
 42	/** The first  cursor. */
 43	private InputCursor firstCursor;
 44	
 45	/** The second  cursor. */
 46	private InputCursor secondCursor;
 47	
 48	/** The scaling point. */
 49	private Vector3D scalingPoint;
 50	
 51	
 52	/**
 53	 * Instantiates a new scale event.
 54	 * 
 55	 * @param source the source
 56	 * @param id the id
 57	 * @param scalingObject the scaling object
 58	 * @param firstCursor the first  cursor
 59	 * @param secondCursor the second  cursor
 60	 * @param scaleFactorX the scale factor x
 61	 * @param scaleFactorY the scale factor y
 62	 * @param scaleFactorZ the scale factor z
 63	 * @param scalingPoint the scaling point
 64	 */
 65	public ScaleEvent(IInputProcessor source, int id, IMTComponent3D scalingObject, InputCursor firstCursor, InputCursor secondCursor, float scaleFactorX, float scaleFactorY, float scaleFactorZ, Vector3D scalingPoint) {
 66		super(source, id, scalingObject);
 67		this.firstCursor = firstCursor;
 68		this.secondCursor = secondCursor;
 69		this.scaleFactorX = scaleFactorX;
 70		this.scaleFactorY = scaleFactorY;
 71		this.scaleFactorZ = scaleFactorZ;
 72		this.scalingPoint = scalingPoint;
 73	}
 74
 75	/**
 76	 * Gets the scale factor x.
 77	 * 
 78	 * @return the scale factor x
 79	 */
 80	public float getScaleFactorX() {
 81		return scaleFactorX;
 82	}
 83
 84	/**
 85	 * Gets the scale factor y.
 86	 * 
 87	 * @return the scale factor y
 88	 */
 89	public float getScaleFactorY() {
 90		return scaleFactorY;
 91	}
 92
 93	/**
 94	 * Gets the scale factor z.
 95	 * 
 96	 * @return the scale factor z
 97	 */
 98	public float getScaleFactorZ() {
 99		return scaleFactorZ;
100	}
101
102	/**
103	 * Gets the scaling point.
104	 * 
105	 * @return the scaling point
106	 */
107	public Vector3D getScalingPoint() {
108		return scalingPoint;
109	}
110
111
112	/**
113	 * Gets the first  cursor.
114	 * 
115	 * @return the first  cursor
116	 */
117	public InputCursor getFirstCursor() {
118		return firstCursor;
119	}
120
121	/**
122	 * Gets the second  cursor.
123	 * 
124	 * @return the second  cursor
125	 */
126	public InputCursor getSecondCursor() {
127		return secondCursor;
128	}
129	
130	/* (non-Javadoc)
131	 * @see java.lang.Object#toString()
132	 */
133	public String toString(){
134		return super.toString() + " - " + " Scaleobject:" + this.getTarget().getName() + " X-Scalefactor: " + scaleFactorX + " Y-Scalefactor:" + scaleFactorY + " Z-Scalefactor:" + scaleFactorZ + " Scalingpoint:" + scalingPoint;
135	}
136
137	/**
138	 * Sets the first  cursor.
139	 * 
140	 * @param firstCursor the new first  cursor
141	 */
142	public void setFirstCursor(InputCursor firstCursor) {
143		this.firstCursor = firstCursor;
144	}
145
146	/**
147	 * Sets the scale factor x.
148	 * 
149	 * @param scaleFactorX the new scale factor x
150	 */
151	public void setScaleFactorX(float scaleFactorX) {
152		this.scaleFactorX = scaleFactorX;
153	}
154
155	/**
156	 * Sets the scale factor y.
157	 * 
158	 * @param scaleFactorY the new scale factor y
159	 */
160	public void setScaleFactorY(float scaleFactorY) {
161		this.scaleFactorY = scaleFactorY;
162	}
163
164	/**
165	 * Sets the scale factor z.
166	 * 
167	 * @param scaleFactorZ the new scale factor z
168	 */
169	public void setScaleFactorZ(float scaleFactorZ) {
170		this.scaleFactorZ = scaleFactorZ;
171	}
172
173	/**
174	 * Sets the scaling point.
175	 * 
176	 * @param scalingPoint the new scaling point
177	 */
178	public void setScalingPoint(Vector3D scalingPoint) {
179		this.scalingPoint = scalingPoint;
180	}
181
182	/**
183	 * Sets the second  cursor.
184	 * 
185	 * @param secondCursor the new second  cursor
186	 */
187	public void setSecondCursor(InputCursor secondCursor) {
188		this.secondCursor = secondCursor;
189	}
190	
191	
192	
193
194}