Package de.lessvoid.nifty.elements

Examples of de.lessvoid.nifty.elements.Element$LocalEndNotify


    }

    String target = parameter.getProperty("targetElement");
    if (target != null) {
      TargetElementResolver resolver = new TargetElementResolver(nifty.getCurrentScreen(), element);
      Element targetElement = resolver.resolve(target);
      if (targetElement == null) {
        log.warning("move effect for element [" + element.getId() + "] was unable to find target element [" + target + "] at screen [" + nifty.getCurrentScreen().getScreenId() + "]");
        return;
      }

      if ("fromPosition".equals(mode)) {
        startOffsetX = targetElement.getX() - element.getX();
        startOffsetY = targetElement.getY() - element.getY();
        offsetX = -(targetElement.getX() - element.getX());
        offsetY = -(targetElement.getY() - element.getY());
      } else if ("toPosition".equals(mode)) {
        startOffsetX = 0;
        startOffsetY = 0;
        offsetX = (targetElement.getX() - element.getX());
        offsetY = (targetElement.getY() - element.getY());
      }
    }
  }
View Full Code Here


  public void processMouseOverEvent(
      final Element rootElement,
      final NiftyMouseInputEvent mouseEvent,
      final long eventTime) {
    for (int i = mouseOverElements.size() - 1; i >= 0; i--) {
      Element element = mouseOverElements.get(i);
      if (element.mouseOverEvent(mouseEvent, eventTime)) {
        return;
      }
    }
  }
View Full Code Here

    // hover effect will be activated. This was necessary for the ChangeMouseCursor effect to
    // work correctly when you quickly changed hover from one element to another it was possible
    // that the hover effect for the new element started before the old one was deactivated so
    // the reset of the mousecursor (see ChangeMouseCursor effect) did not worked correctly.
    for (int i = mouseElements.size() - 1; i >= 0; i--) {
      Element element = mouseElements.get(i);
      element.mouseEventHoverPreprocess(mouseEvent, eventTime);
    }

    // second step is to process mouse over elements first
    for (int i = mouseOverElements.size() - 1; i >= 0; i--) {
      Element element = mouseOverElements.get(i);
      if (element.mouseEvent(mouseEvent, eventTime)) {
        return;
      }
    }

    // last step is to process all other elements.
    for (int i = mouseElements.size() - 1; i >= 0; i--) {
      Element element = mouseElements.get(i);
      if (element.mouseEvent(mouseEvent, eventTime)) {
        return;
      }
    }
}
View Full Code Here

    if (interact != null) {
      elementType.setInteract(interact.create());
    }
    elementType.prepare(nifty, screen, parent.getElementType());
    elementType.connectParentControls(parent);
    Element element = elementType.create(
      parent,
      nifty,
      screen,
      layoutPart);
View Full Code Here

    return Integer.toString(px) + "px";
  }

  public Element build(final Nifty nifty, final Screen screen, final Element parent) {
    ElementType type = buildElementType();
    Element result = nifty.createElementFromType(screen, parent, type);
    screen.layoutLayers();
    return result;
  }
View Full Code Here

    layerElementsToRemove.add(layerElement);
  }

  public void removeLayerElement(final String layerId) {
    for (int i=0; i<layerElements.size(); i++) {
      Element layer = layerElements.get(i);
      if (layer.getId().equals(layerId)) {
        removeLayerElement(layer);
        return;
      }
    }
  }
View Full Code Here

    // create the callback
    EndNotify localEndNotify = new EndNotify() {
      public final void perform() {
        for (int i=0; i<layerElements.size(); i++) {
          Element w = layerElements.get(i);
          if (w.isEffectActive(EffectEventId.onStartScreen)) {
            return;
          }
        }
      }
    };

    Element mouseFocusElement = focusHandler.getMouseFocusElement();
    if (mouseFocusElement != null) {
      mouseFocusElement.stopEffect(EffectEventId.onHover);
    }

    focusHandler.pushState();

    // prepare pop up for display
View Full Code Here

  public void layoutLayers() {
    NiftyStopwatch.start();
    layoutLayersCallCount++;

    for (int i=0; i<layerElements.size(); i++) {
      Element w = layerElements.get(i);
      w.layoutElements();
    }
    NiftyStopwatch.stop("Screen.layoutLayers()");
  }
View Full Code Here

  private void resetLayers() {
    nifty.resetMouseInputEvents();

    for (int i=0; i<layerElements.size(); i++) {
      Element w = layerElements.get(i);
      w.resetEffects();
    }
  }
View Full Code Here

    // create the callback
    LocalEndNotify localEndNotify = new LocalEndNotify(effectEventId, endNotify);

    // start the effect for all layers
    for (int i=0; i<layerElements.size(); i++) {
      Element w = layerElements.get(i);
      w.startEffect(effectEventId, localEndNotify);

      if (effectEventId == EffectEventId.onStartScreen) {
        w.onStartScreen();
      }
    }

    // just in case there was no effect activated, we'll check here, if we're already done
    localEndNotify.enable();
View Full Code Here

TOP

Related Classes of de.lessvoid.nifty.elements.Element$LocalEndNotify

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.