Package de.lessvoid.nifty.elements

Examples of de.lessvoid.nifty.elements.Element


    while (true) {
      index++;
      if (index >= entries.size()) {
        index = 0;
      }
      Element nextElement = entries.get(index);
      if (nextElement == current) {
        return current;
      }
      if (nextElement.isFocusable()) {
        return nextElement;
      }
    }
  }
View Full Code Here


    while (true) {
      index--;
      if (index < 0) {
        index = entries.size() - 1;
      }
      Element prevElement = entries.get(index);
      if (prevElement == current) {
        return current;
      }
      if (prevElement.isFocusable()) {
        return prevElement;
      }
    }
  }
View Full Code Here

      keyboardFocusString = keyboardFocusElement.toString();
    }

    StringBuffer focusElements = new StringBuffer();
    for (int i=0; i<entries.size(); i++) {
      Element e = entries.get(i);
      if (i > 0) {
        focusElements.append(", ");
      }
      focusElements.append(e.getId() + (!e.isFocusable() ? "*" : ""));
    }
    return
      "\n"
       + "focus element (mouse):    " + mouseFocusString + "\n"
       + "focus element (keyboard): " + keyboardFocusString + "\n"
View Full Code Here

      // that changed the image.
      element.resetAllEffects();
      element.onEndScreen(screen);

      removeSingleElement(screen, element);
      Element parent = element.getParent();
      if (parent != null) {
        parent.getElements().remove(element);

        // when the parent is the root element then the element we're removing is a layer element
        if (parent == screen.getRootElement()) {
          screen.removeLayerElement(element);
        }
View Full Code Here

    }

    private void removeSingleElement(final Screen screen, final Element element) {
      Iterator < Element > elementIt = element.getElements().iterator();
      while (elementIt.hasNext()) {
        Element el = elementIt.next();
        removeSingleElement(screen, el);
        elementIt.remove();
      }
    }
View Full Code Here

    public ElementMoveAction(final Element destinationElement) {
      this.destinationElement = destinationElement;
    }

    public void perform(final Screen screen, final Element element) {
      Element parent = element.getParent();
      if (parent != null) {
        parent.getElements().remove(element);
      }
      element.setParent(destinationElement);
      destinationElement.add(element);
      screen.layoutLayers();
    }
View Full Code Here

      final Element element,
      final float normalizedTime,
      final Falloff falloff,
      final NiftyRenderEngine r) {
    if (normalizedTime > 0.0) {
      final Element hintLayer = nifty.getCurrentScreen().findElementByName(hintLayerId);
      if (hintLayer != null && !hintLayer.isVisible()) {
        // decide if we can already show the hint
        if (nifty.getNiftyMouse().getNoMouseMovementTime() > hintDelay) {
          Element hintPanel = hintLayer.findElementByName(hintPanelId);
          if (hintPanel != null) {
            hintPanel.setConstraintX(new SizeValue(getPosX(element, hintPanel, r.getWidth()) + "px"));
            hintPanel.setConstraintY(new SizeValue(getPosY(element, hintPanel, r.getHeight()) + "px"));

            hintLayer.layoutElements();
            hintLayer.show();
          }
        }
View Full Code Here

      }
    }
  }

  public void deactivate() {
    final Element hintLayer = nifty.getCurrentScreen().findElementByName(hintLayerId);
    if (hintLayer == null) {
      return;
    }
    if (hintLayer.isVisible()) {
      hintLayer.startEffect(EffectEventId.onCustom, new EndNotify() {
        @Override
        public void perform() {
          hintLayer.markForRemoval();
        }
      });
    } else {
      hintLayer.markForRemoval();
    }
  }
View Full Code Here

  public Element create(
      final Element parent,
      final Nifty nifty,
      final Screen screen,
      final LayoutPart layoutPart) {
    Element element = internalCreateElement(parent, nifty, screen, layoutPart, getAttributes());
    applyStandard(nifty, screen, element);
    return element;
  }
View Full Code Here

      final Element parent,
      final Nifty nifty,
      final Screen screen,
      final LayoutPart layoutPart,
      final Attributes attrib) {
    Element element = new Element(
        nifty,
        this,
        attrib.get("id"),
        parent,
        layoutPart,
View Full Code Here

TOP

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

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.