Examples of SizeValue


Examples of de.lessvoid.nifty.tools.SizeValue

    preProcessConstraintHeightThisLevel();
  }

  private void preProcessConstraintHeightThisLevel() {
    // try the original height value first
    SizeValue myHeight = getConstraintHeight();

    // is it empty and we have an layoutManager there's still hope for a height constraint
    if (layoutManager != null && (myHeight == null || isCalcHeightConstraint)) {
      // collect all child layoutPart that have a fixed px size in a list
      List < LayoutPart > layoutPartChild = new ArrayList < LayoutPart >();
      for (int i=0; i<elements.size(); i++) {
        Element e = elements.get(i);
        SizeValue childHeight = e.getConstraintHeight();
        if (childHeight != null && childHeight.isPixel()) {
          layoutPartChild.add(e.layoutPart);
        }
      }

      // if all (!) child elements have a px fixed height we can calculate a new height constraint for this element!
      if (elements.size() == layoutPartChild.size()) {
        SizeValue newHeight = layoutManager.calculateConstraintHeight(this.layoutPart, layoutPartChild);
        if (newHeight != null) {
          setConstraintHeight(newHeight);
          isCalcHeightConstraint = true;
        }
      }
View Full Code Here

Examples of de.lessvoid.nifty.tools.SizeValue

  private boolean activated = false;

  public void activate(final Nifty nifty, final Element element, final EffectProperties parameter) {
    String startSizeString = parameter.getProperty("startSize");
    if (startSizeString != null) {
      startSize = new SizeValue(startSizeString);
    }

    String endSizeString = parameter.getProperty("endSize");
    if (endSizeString != null) {
      endSize = new SizeValue(endSizeString);
    }
    pulsator = new Pulsator(parameter, new TimeProvider());
  }
View Full Code Here

Examples of de.lessvoid.nifty.tools.SizeValue

    endSize = Float.parseFloat(parameter.getProperty("endSize", "2.0"));

    // for hover mode only
    String maxSizeString = parameter.getProperty("maxSize");
    if (maxSizeString != null) {
      imageSize = new SizeValue(maxSizeString);
    }
    interpolator = parameter.getInterpolator();
  }
View Full Code Here

Examples of de.lessvoid.nifty.tools.SizeValue

  private SizeValue width;

  public void activate(final Nifty nifty, final Element element, final EffectProperties parameter) {
    startColor = new Color(parameter.getProperty("startColor", "#0000"));
    endColor = new Color(parameter.getProperty("endColor", "#ffff"));
    width = new SizeValue(parameter.getProperty("width"));
  }
View Full Code Here

Examples of de.lessvoid.nifty.tools.SizeValue

  private boolean activated = false;

  public void activate(final Nifty nifty, final Element element, final EffectProperties parameter) {
    startColor = new Color(parameter.getProperty("startColor", "#00000000"));
    endColor = new Color(parameter.getProperty("endColor", "#ffffffff"));
    width = new SizeValue(parameter.getProperty("width"));
    changeColorOnly = new Boolean(parameter.getProperty("changeColorOnly", "false"));
    pulsator = new Pulsator(parameter, new TimeProvider());
  }
View Full Code Here

Examples of de.lessvoid.nifty.tools.SizeValue

  private SoundHandle music;

  public void activate(final Nifty niftyParam, final Element element, final EffectProperties parameter) {
    nifty = niftyParam;
    music = nifty.getSoundSystem().getMusic(parameter.getProperty("sound"));
    fromVolume = new SizeValue(parameter.getProperty("from", "0%")).getValue(1.0f);
    toVolume = new SizeValue(parameter.getProperty("to", "100%")).getValue(1.0f);
  }
View Full Code Here

Examples of de.lessvoid.nifty.tools.SizeValue

  private SizeValue insetBottom = new SizeValue("0px");

  public void activate(final Nifty nifty, final Element element, final EffectProperties parameter) {
    try {
      PaddingAttributeParser parser = new PaddingAttributeParser(parameter.getProperty("border", "1px"));
      borderLeft = new SizeValue(parser.getLeft());
      borderRight = new SizeValue(parser.getRight());
      borderTop = new SizeValue(parser.getTop());
      borderBottom = new SizeValue(parser.getBottom());

      parser = new PaddingAttributeParser(parameter.getProperty("color", "#ffff"));
      colorLeft = new Color(parser.getLeft());
      colorRight = new Color(parser.getRight());
      colorTop = new Color(parser.getTop());
      colorBottom = new Color(parser.getBottom());

      parser = new PaddingAttributeParser(parameter.getProperty("inset", "0px"));
      insetLeft = new SizeValue(parser.getLeft());
      insetRight = new SizeValue(parser.getRight());
      insetTop = new SizeValue(parser.getTop());
      insetBottom = new SizeValue(parser.getBottom());
    } catch (Exception e) {
      log.warning(e.getMessage());
    }
  }
View Full Code Here

Examples of de.lessvoid.nifty.tools.SizeValue

      image.setImageMode(ImageModeFactory.getSharedInstance().createImageMode(areaProviderProperty,
          renderStrategyProperty));
    }

    alpha = new Alpha(parameter.getProperty("alpha", "#f"));
    inset = new SizeValue(parameter.getProperty("inset", "0px"));
    width = new SizeValue(parameter.getProperty("width", element.getWidth() + "px"));
    height = new SizeValue(parameter.getProperty("height", element.getHeight() + "px"));
    center = Boolean.valueOf(parameter.getProperty("center", "false"));
    hideIfNotEnoughSpace = Boolean.valueOf(parameter.getProperty("hideIfNotEnoughSpace", "false"));
    activeBeforeStartDelay = Boolean.valueOf(parameter.getProperty("activeBeforeStartDelay", "false"));
  }
View Full Code Here

Examples of de.lessvoid.nifty.tools.SizeValue

  private void updateLayoutPart(final LayoutPart layoutPart, final int width, final int height) {
    Box box = layoutPart.getBox();
    box.setWidth(width);
    box.setHeight(height);
    BoxConstraints boxConstraints = layoutPart.getBoxConstraints();
    boxConstraints.setWidth(new SizeValue(width + "px"));
    boxConstraints.setHeight(new SizeValue(height + "px"));
  }
View Full Code Here

Examples of de.lessvoid.nifty.tools.SizeValue

  private SizeValue insetTop = new SizeValue("0px");
  private SizeValue insetBottom = new SizeValue("0px");

  public void activate(final Nifty nifty, final Element element, final EffectProperties parameter) {
    color = new Color(parameter.getProperty("color", "#ffffffff"));
    width = new SizeValue(parameter.getProperty("width"));
    try {
      PaddingAttributeParser parser = new PaddingAttributeParser(parameter.getProperty("inset", "0px"));
      insetLeft = new SizeValue(parser.getLeft());
      insetRight = new SizeValue(parser.getRight());
      insetTop = new SizeValue(parser.getTop());
      insetBottom = new SizeValue(parser.getBottom());
    } catch (Exception e) {
      log.warning(e.getMessage());
    }
  }
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.