Package de.lessvoid.nifty.controls.dynamic.attributes

Source Code of de.lessvoid.nifty.controls.dynamic.attributes.ControlEffectOnHoverAttributes

package de.lessvoid.nifty.controls.dynamic.attributes;

import java.util.ArrayList;
import java.util.Collections;

import de.lessvoid.nifty.loaderv2.types.EffectTypeOnHover;
import de.lessvoid.nifty.loaderv2.types.EffectValueType;
import de.lessvoid.nifty.loaderv2.types.HoverType;
import de.lessvoid.xml.xpp3.Attributes;

public class ControlEffectOnHoverAttributes extends ControlEffectAttributes {
  private ControlHoverAttributes controlHoverAttributes;

  public ControlEffectOnHoverAttributes() {
  }

  public ControlEffectOnHoverAttributes(final Attributes attributes, final ArrayList<EffectValueType> effectValues, final HoverType hoverType) {
    this.attributes = new Attributes(attributes);
    this.effectValues = new ArrayList<EffectValueType>(effectValues);
    Collections.copy(this.effectValues, effectValues);
    this.controlHoverAttributes = new ControlHoverAttributes(hoverType);
  }

  public void setControlHoverAttributes(final ControlHoverAttributes controlHoverAttributesParam) {
    controlHoverAttributes = controlHoverAttributesParam;
  }

  public EffectTypeOnHover create() {
    EffectTypeOnHover effectTypeOnHover = new EffectTypeOnHover();
    effectTypeOnHover.initFromAttributes(attributes);
    for (int i=0; i<effectValues.size(); i++) {
      effectTypeOnHover.addValue(effectValues.get(i));
    }
    if (controlHoverAttributes != null) {
      effectTypeOnHover.setHover(controlHoverAttributes.create());
    }
    return effectTypeOnHover;
  }
}
TOP

Related Classes of de.lessvoid.nifty.controls.dynamic.attributes.ControlEffectOnHoverAttributes

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.