Examples of SizeValue


Examples of de.lessvoid.nifty.tools.SizeValue

  }

  @SuppressWarnings({ "deprecation", "rawtypes" })
  private void linkPopupToDropDownPosition(final DropDownControl<T> dropDownControl) {
    Element panel = getElement().findElementByName("#panel");
    panel.setConstraintX(new SizeValue(dropDownControl.getElement().getX() + "px"));
    panel.setConstraintWidth(new SizeValue(dropDownControl.getWidth() + "px"));
    getElement().layoutElements();

    ListBoxControl listBox = getElement().findNiftyControl("#listBox", ListBoxControl.class);
    listBox.ensureWidthConstraints();

    panel.setConstraintHeight(new SizeValue(listBox.getHeight() + "px"));

    if ((dropDownControl.getElement().getY() + listBox.getHeight()) > nifty.getRenderEngine().getHeight()) {
      panel.setConstraintY(new SizeValue(dropDownControl.getElement().getY() - listBox.getHeight() + "px"));
      updateMoveEffect(listBox, 1);
    } else {
      panel.setConstraintY(new SizeValue(dropDownControl.getElement().getY() + dropDownControl.getHeight() + "px"));
      updateMoveEffect(listBox, -1);
    }
    getElement().layoutElements();
  }
View Full Code Here

Examples of de.lessvoid.nifty.tools.SizeValue

  @Override
  public void setText(final String text) {
    buttonTextRenderer.setText(text);
    if (!buttonTextRenderer.isLineWrapping()) {
      buttonTextElement.setConstraintWidth(new SizeValue(buttonTextRenderer.getTextWidth() + "px"));
    }
  }
View Full Code Here

Examples of de.lessvoid.nifty.tools.SizeValue

          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

Examples of de.lessvoid.nifty.tools.SizeValue

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

Examples of de.lessvoid.nifty.tools.SizeValue

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

Examples of de.lessvoid.nifty.tools.SizeValue

  }

  // Internals

  private void movePopup() {
    element.setConstraintX(new SizeValue(nifty.getNiftyMouse().getX() + "px"));
    element.setConstraintY(new SizeValue(nifty.getNiftyMouse().getY() + "px"));
    element.getParent().layoutElements();
  }
View Full Code Here

Examples of de.lessvoid.nifty.tools.SizeValue

      return;
    }

    int newPositionX = originalPositionX + mouseX - dragStartX;
    int newPositionY = originalPositionY + mouseY - dragStartY;
    draggable.setConstraintX(new SizeValue(newPositionX + "px"));
    draggable.setConstraintY(new SizeValue(newPositionY + "px"));

    popup.layoutElements();
  }
View Full Code Here

Examples of de.lessvoid.nifty.tools.SizeValue

    popup = nifty.createPopup(POPUP);

    draggable.markForMove(popup, new EndNotify() {
      @Override
      public void perform() {
        draggable.setConstraintX(new SizeValue(originalPositionX + "px"));
        draggable.setConstraintY(new SizeValue(originalPositionY + "px"));
        nifty.showPopup(screen, popup.getId(), null);
      }
    });
  }
View Full Code Here

Examples of de.lessvoid.nifty.tools.SizeValue

  private void dragCancel() {
    if (revert) {
      draggable.setConstraintX(originalConstraintX);
      draggable.setConstraintY(originalConstraintY);
    } else {
      draggable.setConstraintX(new SizeValue(draggable.getX() + "px"));
      draggable.setConstraintY(new SizeValue(draggable.getY() + "px"));
    }
    moveDraggableBackToOriginalParent();
    notifyObserversDragCanceled();
  }
View Full Code Here

Examples of de.lessvoid.nifty.tools.SizeValue

    drop(droppedDraggable, endNotify, true);
  }

  private void drop(final DraggableControl droppedDraggable, final EndNotify endNotify, final boolean notifyObservers) {
    draggable = droppedDraggable;
    draggable.getElement().setConstraintX(new SizeValue("0px"));
    draggable.getElement().setConstraintY(new SizeValue("0px"));
    draggable.getElement().markForMove(droppable, endNotify);

    DroppableControl source = droppedDraggable.getDroppable();
    droppedDraggable.setDroppable(this);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.