/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. ***********************************************************************/
  18. package org.mt4j.input.inputProcessors.componentProcessors.scaleProcessor;
  19. import org.mt4j.components.interfaces.IMTComponent3D;
  20. import org.mt4j.input.inputData.InputCursor;
  21. import org.mt4j.input.inputProcessors.IInputProcessor;
  22. import org.mt4j.input.inputProcessors.MTGestureEvent;
  23. import org.mt4j.util.math.Vector3D;
  24. /**
  25. * The Class ScaleEvent.
  26. * @author Christopher Ruff
  27. */
  28. public class ScaleEvent extends MTGestureEvent{
  29. /** The scale factor x. */
  30. private float scaleFactorX;
  31. /** The scale factor y. */
  32. private float scaleFactorY;
  33. /** The scale factor z. */
  34. private float scaleFactorZ;
  35. /** The first cursor. */
  36. private InputCursor firstCursor;
  37. /** The second cursor. */
  38. private InputCursor secondCursor;
  39. /** The scaling point. */
  40. private Vector3D scalingPoint;
  41. /**
  42. * Instantiates a new scale event.
  43. *
  44. * @param source the source
  45. * @param id the id
  46. * @param scalingObject the scaling object
  47. * @param firstCursor the first cursor
  48. * @param secondCursor the second cursor
  49. * @param scaleFactorX the scale factor x
  50. * @param scaleFactorY the scale factor y
  51. * @param scaleFactorZ the scale factor z
  52. * @param scalingPoint the scaling point
  53. */
  54. public ScaleEvent(IInputProcessor source, int id, IMTComponent3D scalingObject, InputCursor firstCursor, InputCursor secondCursor, float scaleFactorX, float scaleFactorY, float scaleFactorZ, Vector3D scalingPoint) {
  55. super(source, id, scalingObject);
  56. this.firstCursor = firstCursor;
  57. this.secondCursor = secondCursor;
  58. this.scaleFactorX = scaleFactorX;
  59. this.scaleFactorY = scaleFactorY;
  60. this.scaleFactorZ = scaleFactorZ;
  61. this.scalingPoint = scalingPoint;
  62. }
  63. /**
  64. * Gets the scale factor x.
  65. *
  66. * @return the scale factor x
  67. */
  68. public float getScaleFactorX() {
  69. return scaleFactorX;
  70. }
  71. /**
  72. * Gets the scale factor y.
  73. *
  74. * @return the scale factor y
  75. */
  76. public float getScaleFactorY() {
  77. return scaleFactorY;
  78. }
  79. /**
  80. * Gets the scale factor z.
  81. *
  82. * @return the scale factor z
  83. */
  84. public float getScaleFactorZ() {
  85. return scaleFactorZ;
  86. }
  87. /**
  88. * Gets the scaling point.
  89. *
  90. * @return the scaling point
  91. */
  92. public Vector3D getScalingPoint() {
  93. return scalingPoint;
  94. }
  95. /**
  96. * Gets the first cursor.
  97. *
  98. * @return the first cursor
  99. */
  100. public InputCursor getFirstCursor() {
  101. return firstCursor;
  102. }
  103. /**
  104. * Gets the second cursor.
  105. *
  106. * @return the second cursor
  107. */
  108. public InputCursor getSecondCursor() {
  109. return secondCursor;
  110. }
  111. /* (non-Javadoc)
  112. * @see java.lang.Object#toString()
  113. */
  114. public String toString(){
  115. return super.toString() + " - " + " Scaleobject:" + this.getTarget().getName() + " X-Scalefactor: " + scaleFactorX + " Y-Scalefactor:" + scaleFactorY + " Z-Scalefactor:" + scaleFactorZ + " Scalingpoint:" + scalingPoint;
  116. }
  117. /**
  118. * Sets the first cursor.
  119. *
  120. * @param firstCursor the new first cursor
  121. */
  122. public void setFirstCursor(InputCursor firstCursor) {
  123. this.firstCursor = firstCursor;
  124. }
  125. /**
  126. * Sets the scale factor x.
  127. *
  128. * @param scaleFactorX the new scale factor x
  129. */
  130. public void setScaleFactorX(float scaleFactorX) {
  131. this.scaleFactorX = scaleFactorX;
  132. }
  133. /**
  134. * Sets the scale factor y.
  135. *
  136. * @param scaleFactorY the new scale factor y
  137. */
  138. public void setScaleFactorY(float scaleFactorY) {
  139. this.scaleFactorY = scaleFactorY;
  140. }
  141. /**
  142. * Sets the scale factor z.
  143. *
  144. * @param scaleFactorZ the new scale factor z
  145. */
  146. public void setScaleFactorZ(float scaleFactorZ) {
  147. this.scaleFactorZ = scaleFactorZ;
  148. }
  149. /**
  150. * Sets the scaling point.
  151. *
  152. * @param scalingPoint the new scaling point
  153. */
  154. public void setScalingPoint(Vector3D scalingPoint) {
  155. this.scalingPoint = scalingPoint;
  156. }
  157. /**
  158. * Sets the second cursor.
  159. *
  160. * @param secondCursor the new second cursor
  161. */
  162. public void setSecondCursor(InputCursor secondCursor) {
  163. this.secondCursor = secondCursor;
  164. }
  165. }