Package de.lessvoid.nifty.effects

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

package de.lessvoid.nifty.effects;

import java.util.Map;
import java.util.Properties;

import de.lessvoid.nifty.tools.LinearInterpolator;
import de.lessvoid.xml.xpp3.Attributes;

public class EffectProperties extends Properties {
  private static final long serialVersionUID = 1L;
  private EffectPropertiesValues effectValues = new EffectPropertiesValues();
 
  public EffectProperties(final Properties createProperties) {
    super();

    for (Map.Entry<Object, Object> entry : createProperties.entrySet()) {
      put(entry.getKey(), entry.getValue());
    }
  }

  public void addEffectValue(final Attributes effectProperties) {
    effectValues.add(effectProperties);
  }

  public EffectPropertiesValues getEffectValues() {
    return effectValues;
  }

  public boolean isTimeInterpolator() {
    return effectValues.containsTimeValues();
  }

  public LinearInterpolator getInterpolator() {
    LinearInterpolator interpolator = effectValues.toLinearInterpolator();
    if (interpolator == null) {
      return null;
    }
    interpolator.prepare();
    return interpolator;
  }
}
TOP

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

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.