Package de.lessvoid.nifty.elements

Examples of de.lessvoid.nifty.elements.Element


  public String outputElement(final Element w, final String offset, final String regexpElement, final String regexpAttribute) {
    StringBuffer result = new StringBuffer();
    List<Element> wwElements = w.getElements();
    for (int i=0; i<wwElements.size(); i++) {
      Element ww = wwElements.get(i);
      String elementId = getIdText(ww);
      if (elementId.matches(regexpElement)) {
        result.append("\n" + offset + elementId + " " + ww.getElementType().getClass().getSimpleName() + " childLayout [" + ww.getElementType().getAttributes().get("childLayout") + "]")
        result.append("\n" + StringHelper.whitespace(offset.length()) + ww.getElementStateString(StringHelper.whitespace(offset.length()), regexpAttribute));
        result.append(outputElement(ww, offset + " ", ".*", regexpAttribute));
      } else {
        result.append(outputElement(ww, offset + " ", regexpElement, regexpAttribute));
      }
    }
View Full Code Here


    }
  }

  private boolean isEffectActive(final List < Element > elements, final EffectEventId effectEventId) {
    for (int i=0; i<elements.size(); i++) {
      Element element = elements.get(i);
      if (element.isEffectActive(effectEventId)) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

    }

    public void perform() {
      if (enabled) {
        for (int i=0; i<layerElements.size(); i++) {
          Element w = layerElements.get(i);
          if (w.isEffectActive(effectEventId)) {
            return;
          }
        }
        if (endNotify != null) {
          endNotify.perform();
View Full Code Here

    this.id(id);
  }

  @Override
  public Element build(final Nifty nifty, final Screen screen, final Element parent) {
    Element e = super.build(nifty, screen, parent);
    screen.addLayerElement(e);
    screen.processAddAndRemoveLayerElements();
    return e;
  }
View Full Code Here

  private void outputElements(final StringBuffer result, final ArrayList<Element> elements) {
    if (elements.isEmpty()) {
      result.append("---");
    } else {
      for (int i = elements.size() - 1; i >= 0; i--) {
        Element element = elements.get(i);
        result.append("[" + element.getId() + "]");
      }
    }
  }
View Full Code Here

  private Screen createScreen(final Nifty nifty) {
    return new Screen(nifty, id, screenController, nifty.getTimeProvider());
  }

  private void addRootElement(final Nifty nifty, final Screen screen) {
    Element rootElement = nifty.getRootLayerFactory().createRootLayer("root", nifty, screen, nifty.getTimeProvider());
    screen.setRootElement(rootElement);
  }
View Full Code Here

  public Element create(
      final Nifty nifty,
      final Screen screen,
      final Element parent) {
    Element layerElement = createLayer(nifty, screen, parent);
    screen.addLayerElement(layerElement);
    screen.processAddAndRemoveLayerElements();
    // if this startControl is called with a screen that is already running (which means
    // that the onStartScreen Event has been called already before) we have to call
    // onStartScreen on the newControl here manually. It won't be called by the screen
    // anymore.
    if (screen.isBound()) {
      layerElement.bindControls(screen);
      layerElement.initControls();
    }
    if (screen.isRunning()) {
      layerElement.startEffect(EffectEventId.onStartScreen);
      layerElement.startEffect(EffectEventId.onActive);
      layerElement.onStartScreen();
    }
    return layerElement;
  }
View Full Code Here

  public Screen build(final Nifty nifty) {
    NiftyStopwatch.start();
    Screen screen = creator.create(nifty);

    Element screenRootElement = screen.getRootElement();
    for (LayerBuilder layerBuilder : layerBuilders) {
      layerBuilder.build(nifty, screen, screenRootElement);
    }

    NiftyStopwatch.stop("ScreenBuilder.build ()");
View Full Code Here

      }
    }
  }

  private void subscribeVerticalScrollbar() {
    Element scrollbar = getElement().findElementByName("#vertical-scrollbar");
    if (scrollbar != null) {
      nifty.subscribe(screen, scrollbar.getId(), ScrollbarChangedEvent.class, verticalScrollbarSubscriber);
    }
  }
View Full Code Here

      nifty.subscribe(screen, scrollbar.getId(), ScrollbarChangedEvent.class, verticalScrollbarSubscriber);
    }
  }

  private void subscribeHorizontalScrollbar() {
    Element scrollbar = getElement().findElementByName("#horizontal-scrollbar");
    if (scrollbar != null) {
      nifty.subscribe(screen, scrollbar.getId(), ScrollbarChangedEvent.class, horizontalScrollbarSubscriber);
    }
  }
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.