Package de.lessvoid.nifty.tools

Examples of de.lessvoid.nifty.tools.SizeValue


      return elementBackground.getWidth() - elementPosition.getWidth();
    }

    @Override
    public void update(final int position) {
      elementPosition.setConstraintX(new SizeValue(position + "px"));
      elementBackground.layoutElements();
    }
View Full Code Here


      return elementBackground.getHeight() - elementPosition.getHeight();
    }

    @Override
    public void update(final int position) {
      elementPosition.setConstraintY(new SizeValue(position + "px"));
      elementBackground.layoutElements();
    }
View Full Code Here

    if (applyWidthConstraintsLastWidth  == width) {
      return;
    }

    applyWidthConstraintsLastWidth = width;
    SizeValue newWidthSizeValue = new SizeValue(width + "px");
    for (Element element : labelElements) {
      if (element != null) {
        element.setConstraintWidth(newWidthSizeValue);
      }
    }
View Full Code Here

      if (vertical != null) {
        nifty.removeElement(screen, vertical);
      }
    }

    childRootElement.setConstraintX(new SizeValue("0px"));
    childRootElement.setConstraintY(new SizeValue("0px"));

    updateBottomRightElement();
    nifty.executeEndOfFrameElementActions();
    screen.layoutLayers();
  }
View Full Code Here

      }
    }
  }

  private void initializeScrollElementHeight() {
    scrollElement.setConstraintHeight(new SizeValue(displayItems * labelTemplateHeight + "px"));
  }
View Full Code Here

      verticalScrollbar = ScrollbarMode.off;
    }
  }

  private void setElementHeight() {
    getElement().setConstraintHeight(new SizeValue(displayItems * labelTemplateHeight + findHorizontalScrollbarHeight() + "px"));
    screen.layoutLayers();
  }
View Full Code Here

    String substring = text.substring(0, cursorPos);
    int textWidth = textRenderer.getFont().getWidth(substring);
    int cursorPixelPos = textWidth - d;

    cursorElement.setConstraintX(new SizeValue(cursorPixelPos + "px"));
    cursorElement.setConstraintY(new SizeValue((getElement().getHeight() - cursorElement.getHeight()) / 2 + CURSOR_Y + "px"));
    cursorElement.startEffect(EffectEventId.onActive, null);
    if (screen != null) {
      screen.layoutLayers();
    }
  }
View Full Code Here

  }

  @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

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

          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

TOP

Related Classes of de.lessvoid.nifty.tools.SizeValue

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.