/src/org/mt4j/sceneManagement/transition/AbstractTransition.java

http://mt4j.googlecode.com/ · Java · 60 lines · 20 code · 8 blank · 32 comment · 1 complexity · efa771438c28c7b063bdea0dc2a13459 MD5 · raw file

  1. /***********************************************************************
  2. * mt4j Copyright (c) 2008 - 2010 Christopher 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.sceneManagement.transition;
  19. import org.mt4j.MTApplication;
  20. import org.mt4j.input.inputProcessors.globalProcessors.AbstractGlobalInputProcessor;
  21. import org.mt4j.sceneManagement.AbstractScene;
  22. /**
  23. * The Class AbstractTransition.
  24. *
  25. * @author Christopher Ruff
  26. */
  27. public abstract class AbstractTransition extends AbstractScene implements ITransition {
  28. /**
  29. * Instantiates a new abstract transition.
  30. *
  31. * @param mtApplication the mt application
  32. * @param name the name
  33. */
  34. public AbstractTransition(MTApplication mtApplication, String name) {
  35. super(mtApplication, name);
  36. //Remove all global input processors - we dont want the transition to respond to input
  37. AbstractGlobalInputProcessor[] inputProcessors = this.getGlobalInputProcessors();
  38. for (AbstractGlobalInputProcessor abstractGlobalInputProcessor : inputProcessors) {
  39. this.unregisterGlobalInputProcessor(abstractGlobalInputProcessor);
  40. }
  41. }
  42. /* (non-Javadoc)
  43. * @see org.mt4j.sceneManagement.AbstractScene#registerDefaultGlobalInputProcessors()
  44. */
  45. @Override
  46. protected void registerDefaultGlobalInputProcessors() { } //DONT REGISTER INPUT PROCESSORS!
  47. @Override
  48. public void onEnter() {
  49. }
  50. @Override
  51. public abstract void onLeave();
  52. }