Package de.lessvoid.nifty.controls

Examples of de.lessvoid.nifty.controls.Scrollbar


    return false;
  }

  @Override
  public void setHorizontalPos(final float xPos) {
    Scrollbar horizontalS = getElement().findNiftyControl("#nifty-internal-horizontal-scrollbar", Scrollbar.class);
    if (horizontalS != null && verticalScrollbar) {
      horizontalS.setValue(xPos);
    }
  }
View Full Code Here


    }
  }

  @Override
  public float getHorizontalPos() {
    Scrollbar horizontalS = getElement().findNiftyControl("#nifty-internal-horizontal-scrollbar", Scrollbar.class);
    if (horizontalS != null && verticalScrollbar) {
      return horizontalS.getValue();
    }
    return 0.f;
  }
View Full Code Here

    return 0.f;
  }

  @Override
  public void setVerticalPos(final float yPos) {
    Scrollbar verticalS = getElement().findNiftyControl("#nifty-internal-vertical-scrollbar", Scrollbar.class);
    if (verticalS != null && verticalScrollbar) {
      verticalS.setValue(yPos);
    }
  }
View Full Code Here

    }
  }

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

  }

  @Override
  public void setStepSizeX(final float stepSizeX) {
    this.stepSizeX = stepSizeX;
    Scrollbar horizontalS = getElement().findNiftyControl("#nifty-internal-horizontal-scrollbar", Scrollbar.class);
    if (horizontalS != null) {
      horizontalS.setButtonStepSize(stepSizeX);
    }
  }
View Full Code Here

  }

  @Override
  public void setStepSizeY(final float stepSizeY) {
    this.stepSizeY = stepSizeY;
    Scrollbar verticalS = getElement().findNiftyControl("#nifty-internal-vertical-scrollbar", Scrollbar.class);
    if (verticalS != null) {
      verticalS.setButtonStepSize(stepSizeY);
    }
  }
View Full Code Here

  }

  @Override
  public void setPageSizeX(final float pageSizeX) {
    this.pageSizeX = pageSizeX;
    Scrollbar horizontalS = getElement().findNiftyControl("#nifty-internal-horizontal-scrollbar", Scrollbar.class);
    if (horizontalS != null) {
      horizontalS.setPageStepSize(pageSizeX);
    }
  }
View Full Code Here

  }

  @Override
  public void setPageSizeY(final float pageSizeY) {
    this.pageSizeY = pageSizeY;
    Scrollbar verticalS = getElement().findNiftyControl("#nifty-internal-vertical-scrollbar", Scrollbar.class);
    if (verticalS != null) {
      verticalS.setPageStepSize(pageSizeY);
    }
  }
View Full Code Here

    }
  }

  public void mouseWheel(final Element e, final NiftyMouseInputEvent inputEvent) {
    int mouseWheel = inputEvent.getMouseWheel();
    Scrollbar verticalS = getElement().findNiftyControl("#nifty-internal-vertical-scrollbar", Scrollbar.class);
    if (verticalS != null) {
      float currentValue = verticalS.getValue();
      if (mouseWheel < 0) {
        verticalS.setValue(currentValue - verticalS.getButtonStepSize() * mouseWheel);
      } else if (mouseWheel > 0) {
        verticalS.setValue(currentValue - verticalS.getButtonStepSize() * mouseWheel);
      }
    }
  }
View Full Code Here

      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

TOP

Related Classes of de.lessvoid.nifty.controls.Scrollbar

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.