Package de.lessvoid.xml.xpp3

Examples of de.lessvoid.xml.xpp3.XmlParser


  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);
  }
View Full Code Here


import de.lessvoid.nifty.screen.Screen;
import de.lessvoid.xml.xpp3.Attributes;

public class CustomControlCreator extends ControlAttributes {
  public CustomControlCreator(final ControlType source) {
    attributes = new Attributes(source.getAttributes());
    interact = new ControlInteractAttributes(source.getInteract());
    effects = new ControlEffectsAttributes(source.getEffects());
  }
View Full Code Here

  /**
   * Support for CustomControlCreator
   * @param interact
   */
  public ControlInteractAttributes(final InteractType interact) {
    this.attributes = new Attributes(interact.getAttributes());
  }
View Full Code Here

      final Nifty nifty,
      final Element element,
      final EffectEventId effectEventId,
      final Attributes effectsTypeAttibutes,
      final LinkedList < Object > controllers) {
    Attributes effectAttributes = new Attributes(getAttributes());
    effectAttributes.merge(effectsTypeAttibutes);

    Attributes attributes = effectAttributes;

    RegisterEffectType registerEffectType = getRegisteredEffectType(nifty, attributes);
    if (registerEffectType == null) {
      return;
    }

    Class < ? > effectClass = registerEffectType.getEffectClass();
    if (effectClass == null) {
      return;
    }

    EffectProperties effectProperties = new EffectProperties(attributes.createProperties());
    applyEffectValues(effectProperties);

    Effect effect = createEffect(nifty, effectEventId, attributes);
    effect.init(
        element,
View Full Code Here

    parent = parentParam;
    controlAttributes = controlAttributesParam;
  }

  public Attributes resolve(final Attributes attributes) {
    Attributes result = new Attributes(attributes);

    for (Entry entry : getParameterSet(attributes)) {
      String key = (String) entry.getKey();
      String value = (String) entry.getValue();
      if (controlAttributes.isSet(key)) {
        result.set(value, controlAttributes.get(key));
      }
    }

    Attributes res = parent.resolve(result);
    for (Entry entry : getParameterSet(attributes)) {
      String value = (String) entry.getValue();
      result.set(value, "");
    }
    return res;
View Full Code Here

  public RegisterEffectType() {
  }

  public RegisterEffectType(final String nameParam, final String classParam) {
    Attributes attributes = new Attributes();
    attributes.set("name", nameParam);
    attributes.set("class", classParam);
    try {
      initFromAttributes(attributes);
    } catch (Exception e) {
      logger.warning(
          "unable to register effect [" + nameParam + "] for class [" + classParam + "] (" + e.getMessage() + "]");
View Full Code Here

    String name = getNameAttribute(attributes);

    Type type = new Type(name, getExtendsAttribute(attributes));
    niftyXmlSchema.addType(name, type);

    SubstitutionGroup substGroup = new SubstitutionGroup();
    substGroup.add("element", new TypeProcessorElement(type));
    substGroup.add("group", new TypeProcessorSubstitutionGroup(type));

    xmlParser.nextTag();
    xmlParser.zeroOrMore(substGroup);
  }
View Full Code Here

      final Nifty nifty) throws Exception {
    try {
      long start = timeProvider.getMsTime();
      log.info("loading new nifty xml file with schemaId [" + schemaId + "]");

      XmlParser parser = new XmlParser(new MXParser());
      parser.read(inputStreamXml);

      NiftyType niftyType = (NiftyType) getSchema(schemaId).loadXml(parser);
      niftyType.loadStyles(this, nifty);
      niftyType.loadControls(this);
View Full Code Here

      final String styleFilename,
      final NiftyType niftyType,
      final Nifty nifty) throws Exception {
    log.info("loading new nifty style xml file [" + styleFilename + "] with schemaId [" + schemaId + "]");

    XmlParser parser = new XmlParser(new MXParser());
    InputStream stream = ResourceLoader.getResourceAsStream(styleFilename);
    try {
      parser.read(stream);
      NiftyStylesType niftyStylesType = (NiftyStylesType) getSchema(schemaId).loadXml(parser);
      niftyStylesType.loadStyles(this, niftyType, nifty, log);
    } finally {
      stream.close();
    }
View Full Code Here

      final String schemaId,
      final String controlFilename,
      final NiftyType niftyType) throws Exception {
    log.info("loading new nifty controls xml file [" + controlFilename + "] with schemaId [" + schemaId + "]");

    XmlParser parser = new XmlParser(new MXParser());
    InputStream stream = ResourceLoader.getResourceAsStream(controlFilename);
    try {
      parser.read(stream);
      NiftyControlsType niftyControlsType = (NiftyControlsType) getSchema(schemaId).loadXml(parser);
      niftyControlsType.loadControls(this, niftyType);
    } finally {
      stream.close();
    }
View Full Code Here

TOP

Related Classes of de.lessvoid.xml.xpp3.XmlParser

Copyright © 2018 www.massapicom. 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.