Package de.lessvoid.nifty.elements

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


    if (childRootElement != null) {
      List<Element> elements = childRootElement.getElements();
      if (elements.isEmpty()) {
        return;
      }
      final Element scrollElement = elements.get(0);
      if (scrollElement != null) {
        Scrollbar horizontalS = getElement().findNiftyControl("#nifty-internal-horizontal-scrollbar", Scrollbar.class);
        if (horizontalS != null) {
          horizontalS.setWorldMax(scrollElement.getWidth());
          horizontalS.setWorldPageSize(horizontalS.getWidth());
          updateWorldH();
        }

        Scrollbar verticalS = getElement().findNiftyControl("#nifty-internal-vertical-scrollbar", Scrollbar.class);
        if (verticalS != null) {
          verticalS.setWorldMax(scrollElement.getHeight());
          verticalS.setWorldPageSize(verticalS.getHeight());
          updateWorldV();
        }
      }
    }
View Full Code Here


      }
    }
  }

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

    }
  }

  private void initializeScrollPanel() {
    if (!verticalScrollbar) {
      Element vertical = getElement().findElementByName("#nifty-internal-vertical-scrollbar");
      if (vertical != null) {
        nifty.removeElement(screen, vertical);
      }
    }
    if (!horizontalScrollbar) {
      Element horizontal = getElement().findElementByName("#nifty-internal-horizonal-panel");
      if (horizontal != null) {
        nifty.removeElement(screen, horizontal);
      }
    }
    nifty.executeEndOfFrameElementActions();
View Full Code Here

    if (childRootElement != null) {
      List<Element> elements = childRootElement.getElements();
      if (elements.isEmpty()) {
        return;
      }
      final Element scrollElement = elements.get(0);
      if (scrollElement != null) {
        Scrollbar horizontalS = getElement().findNiftyControl("#nifty-internal-horizontal-scrollbar", Scrollbar.class);
        if (horizontalS != null) {
          horizontalS.setWorldMax(scrollElement.getWidth());
          updateWorldH();
          horizontalS.setWorldPageSize(horizontalS.getWidth());
          horizontalS.setValue(0.0f);
          horizontalS.setButtonStepSize(stepSizeX);
          horizontalS.setPageStepSize(pageSizeX);
        }

        Scrollbar verticalS = getElement().findNiftyControl("#nifty-internal-vertical-scrollbar", Scrollbar.class);
        if (verticalS != null) {
          verticalS.setWorldMax(scrollElement.getHeight());
          updateWorldV();
          verticalS.setWorldPageSize(verticalS.getHeight());
          verticalS.setValue(0.0f);
          verticalS.setButtonStepSize(stepSizeY);
          verticalS.setPageStepSize(pageSizeY);
        }
        scrollElement.setConstraintX(new SizeValue("0px"));
        scrollElement.setConstraintY(new SizeValue("0px"));
      }
      scrollElement.layoutElements();
    }
  }
View Full Code Here

        return;
      }
      if (childRootElement.getElements().isEmpty()) {
        return;
      }
      final Element scrollElement = childRootElement.getElements().get(0);
      if (scrollElement != null) {
        scrollElement.setConstraintY(new SizeValue(-(int) event.getValue() + "px"));
        updateWorldV();
        scrollElement.getParent().layoutElements();

        float xPos = 0.f;
        Scrollbar horizontalS = getElement().findNiftyControl("#nifty-internal-horizontal-scrollbar", Scrollbar.class);
        if (horizontalS != null && horizontalScrollbar) {
          xPos = horizontalS.getValue();
View Full Code Here

        return;
      }
      if (childRootElement.getElements().isEmpty()) {
        return;
      }
      final Element scrollElement = childRootElement.getElements().get(0);
      if (scrollElement != null) {
        scrollElement.setConstraintX(new SizeValue(-(int) event.getValue() + "px"));
        updateWorldH();
        scrollElement.getParent().layoutElements();

        float yPos = 0.f;
        Scrollbar verticalS = getElement().findNiftyControl("#nifty-internal-vertical-scrollbar", Scrollbar.class);
        if (verticalS != null && verticalScrollbar) {
          yPos = verticalS.getValue();
View Full Code Here

  public void dragStop() {
    if (!dragged) {
      return;
    }
    logger.fine("dragStop()");
    Element newDroppable = findDroppableAtCurrentCoordinates();
    if (newDroppable == originalParent) {
      dragCancel();
    } else {
      DroppableControl droppableControl = newDroppable.getControl(DroppableControl.class);
      if (droppableControl.accept(droppable, this)) {
        droppableControl.drop(this, closePopup());
      } else {
        dragCancel();
      }
View Full Code Here

      int dragAnkerX = draggable.getX() + draggable.getWidth() / 2;
      int dragAnkerY = draggable.getY() + draggable.getHeight() / 2;
      List<Element> layers = screen.getLayerElements();
      ListIterator<Element> iter = layers.listIterator(layers.size());
      while (iter.hasPrevious()) {
        Element layer = iter.previous();
        if (popup != null && layer != popup) {
          Element droppable = findDroppableAtCoordinates(layer, dragAnkerX, dragAnkerY);
          if (droppable != null) {
            return droppable;
          }
        }
      }
View Full Code Here

  private Element findDroppableAtCoordinates(final Element context, final int x, final int y) {
    List<Element> elements = context.getElements();
    ListIterator<Element> iter = elements.listIterator(elements.size());
    while (iter.hasPrevious()) {
      Element element = iter.previous();
      boolean mouseInside = element.isMouseInsideElement(x, y);
      if (mouseInside && isDroppable(element)) {
        return element;
      }
      Element droppable = findDroppableAtCoordinates(element, x, y);
      if (droppable != null) {
        return droppable;
      }
      if (mouseInside && element.isVisibleToMouseEvents()) {
        return originalParent;
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.