Package de.lessvoid.nifty.tools

Examples of de.lessvoid.nifty.tools.SizeValue


            return;
        }

        NiftyImage currentImage = images.get(currentImageIndex);
        imageElement.getRenderer(ImageRenderer.class).setImage(currentImage);
        imageElement.setConstraintWidth(new SizeValue(currentImage.getWidth() + "px"));
        imageElement.setConstraintHeight(new SizeValue(currentImage.getHeight() + "px"));
        imageElement.layoutElements();

        if (currentImageIndex == 0) {
            backElement.hide();
            backButtonElement.disable();
View Full Code Here


        }
      } else {
        if (getElement().isVisible()) {
          elementPosition.show();
        }
        elementPosition.setConstraintY(new SizeValue(pos + "px"));
        elementPosition.setConstraintHeight(new SizeValue(size + "px"));
        elementBackground.layoutElements();
      }
    }
View Full Code Here

        }
      } else {
        if (getElement().isVisible()) {
          elementPosition.show();
        }
        elementPosition.setConstraintX(new SizeValue(pos + "px"));
        elementPosition.setConstraintWidth(new SizeValue(size + "px"));
        elementBackground.layoutElements();
      }
    }
View Full Code Here

    }

    public void setHealth(final float health) {
        final int MIN_WIDTH = 10; //10 pixels
        int pixelWidth = (int) (MIN_WIDTH + (healthBar.getParent().getWidth() - MIN_WIDTH) * health);
        healthBar.setConstraintWidth(new SizeValue(pixelWidth + "px"));
        healthBar.getParent().layoutElements();

        this.health = (int) health;
    }
View Full Code Here

        if (progress < 0.0f) progress = 0.0f;
        else if (progress > 1.0f) progress = 1.0f;

        pixelWidth = (int) (MIN_WIDTH + (progressBarElement.getParent().getWidth() - MIN_WIDTH) * progress);
        progressBarElement.setConstraintWidth(new SizeValue(pixelWidth + "px"));
        progressBarElement.getParent().layoutElements();
    }
View Full Code Here

        .getRenderStrategyProperty("subImage:0," + progressFreeValue
            + ",27," + pixelHeight);
    image.setImageMode(ImageModeFactory.getSharedInstance()
        .createImageMode(areaProviderProperty, renderStrategyProperty));
    progressElement.getRenderer(ImageRenderer.class).setImage(image);
    progressElement.setConstraintY(new SizeValue(Integer
        .toString(progressFreeValue + 6) + "px"));
    progressElement.setConstraintHeight(new SizeValue(pixelHeight+ "px"));
    progressElement.getParent().layoutElements();
  }
View Full Code Here

  }

  public void setProgress(final int maxValue, final int value) {
    int pixelWidth = (int) (PROGRESS_WIDTH * ((float) value / maxValue));
    progressElement.setConstraintWidth(new SizeValue(pixelWidth + "px"));
    progressElement.getParent().layoutElements();
  }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    private void createGeometryMenu() {
        geometryMenu = geometryPopupMenu.findNiftyControl("#menu", Menu.class);
        geometryMenu.setWidth(new SizeValue("175px"));
        geometryMenu.addMenuItem("Show bound", null, MENU_SHOW_BOUND);
        geometryMenu.addMenuItem("Show normals", null, MENU_SHOW_NORMALS);
        geometryMenu.addMenuItem("Show wireframe", null, MENU_SHOW_WIREFRAME);
    }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    private void createVoxelMenu() {
        voxelMenu = voxelPopupMenu.findNiftyControl("#menu", Menu.class);
        voxelMenu.setWidth(new SizeValue("175px"));
        voxelMenu.addMenuItem("Show surface bound", null, MENU_SHOW_BOUND);
        voxelMenu.addMenuItem("Show chunk bounds", null, MENU_SHOW_CHUNK_BOUNDS);
        voxelMenu.addMenuItem("Show chunk lods", null, MENU_SHOW_CHUNK_LODS);
        voxelMenu.addMenuItem("Show normals", null, MENU_SHOW_NORMALS);
        voxelMenu.addMenuItem("Show wireframe", null, MENU_SHOW_WIREFRAME);
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.