Package de.lessvoid.nifty.effects

Source Code of de.lessvoid.nifty.effects.EffectEvents

package de.lessvoid.nifty.effects;

import java.util.LinkedList;
import java.util.Properties;

import de.lessvoid.nifty.Nifty;
import de.lessvoid.nifty.NiftyMethodInvoker;

public class EffectEvents {
  private NiftyMethodInvoker onStartEffect;
  private NiftyMethodInvoker onEndEffect;

  public void init(final Nifty nifty, final LinkedList < Object > controllers, final Properties parameter) {
    String onStartEffectString = parameter.getProperty("onStartEffect");
    if (onStartEffectString != null) {
      onStartEffect = new NiftyMethodInvoker(nifty, onStartEffectString, controllers.toArray());
    }
    String onEndEffectString = parameter.getProperty("onEndEffect");
    if (onEndEffectString != null) {
      onEndEffect = new NiftyMethodInvoker(nifty, onEndEffectString, controllers.toArray());
    }
  }

  public void onStartEffect(final Properties parameter) {
    if (onStartEffect != null) {
      onStartEffect.invoke(parameter);
    }
  }

  public void onEndEffect() {
    if (onEndEffect != null) {
      onEndEffect.invoke();
    }
  }
}
TOP

Related Classes of de.lessvoid.nifty.effects.EffectEvents

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.