Package com.drakulo.games.ais.ui.component

Examples of com.drakulo.games.ais.ui.component.ProgressBar


   *            The progress color
   * @return the progress bar
   */
  public static ProgressBar createBar(String title, Color color,
      boolean displayValues) {
    ProgressBar pb = new ProgressBar(displayValues);
    pb.setWidth(102);
    pb.setHeight(20);
    pb.setEmptyColor(Color.darkGray);
    pb.setFilledColor(color);
    pb.setTitle(FontHelper.firstToUpper(title));
    return pb;
  }
View Full Code Here


  public ResearchState(int id) {
    super(id);
    this.roots = new ArrayList<UITechnology>();
    this.parents = new ArrayList<UITechnology>();
    this.children = new ArrayList<UITechnology>();
    this.researchProgress = new ProgressBar();
    this.researchProgress.setWidth(202);
    this.researchProgress.setHeight(10);
    this.researchProgress.setEmptyColor(Color.darkGray);
    this.researchProgress.setFilledColor(Color.magenta);
    this.researchProgress.setX(10);
View Full Code Here

    }

    // Resource progress bars updates
    Resource[] resources = Resource.values();
    for (Resource r : resources) {
      ProgressBar pb = this.resourceBars.get(r);
      pb.update(input);
    }

    // Handling research buttons
    ResearchAction action = GameData.getSelectedColony().getResearch();
    if (action == null) {
View Full Code Here

    initializeScrollZones();

    // Progress bars
    this.resourceBars = new HashMap<Resource, ProgressBar>();
    for (Resource r : resources) {
      ProgressBar pb = UIHelper.createBar(r.getI18n(), r.getColor(),
          false);
      this.resourceBars.put(r, pb);
    }
    this.robotBar = UIHelper.createBar("Robots", Color.white, true);

    this.selectedBuildingPB = new ProgressBar();
    this.selectedBuildingPB.setHeight(10);
    this.selectedBuildingPB.setWidth(202);
    this.selectedBuildingPB.setEmptyColor(Color.darkGray);
    this.selectedBuildingPB.setFilledColor(Color.magenta);
View Full Code Here

    this.minimap.update(input);

    // Resource progress bars updates
    Resource[] resources = Resource.values();
    for (Resource r : resources) {
      ProgressBar pb = this.resourceBars.get(r);
      pb.update(input);
    }
    this.robotBar.update(input);

    if (GameData.getSelectedColony().isCommandCenterBuilt()) {
      SectorState.this.buildWindow.setCommandCenterBuilt(true);
View Full Code Here

    int x = ox;
    BigDecimal inStore;
    BigDecimal max;
    StringBuilder builder = new StringBuilder();
    Resource[] resources = Resource.values();
    ProgressBar pb;
    Map<Resource, BigDecimal> modifiers = GameData.getSelectedColony()
        .getLastModifiers();
    BigDecimal modifier;

    // Progress bar of robots use
    UIHelper.drawDarkBox(g, x + padding, oy + padding, 24, 20);
    Image img = ImageManager.getGfx("robot-small");
    img.draw(x + padding + 2, oy + padding);
    BigDecimal maxVal = BigDecimal.valueOf(GameData.getSelectedColony()
        .getTotalRobots());
    BigDecimal curVal = BigDecimal.valueOf(GameData.getSelectedColony()
        .getAvailableRobots());
    this.robotBar.setMaxValue(maxVal);
    this.robotBar.setValue(curVal);
    this.robotBar.setX(x + padding + 24);
    this.robotBar.setY(oy + padding);
    this.robotBar.render(g);

    // Rendering values
    // builder.setLength(0);
    // builder.append(curVal).append("/").append(maxVal);
    // font.drawString(x + padding, oy + 22, builder.toString());
    final int padd = 18;

    // Rendering of the rows titles
    int y = oy + 25;
    this.storeTitle.setPosition(x, y);
    y += padd;
    this.modifierTitle.setPosition(x, y);
    y += padd;
    this.availableSpaceTitle.setPosition(x, y);
    y += padd;
    this.maxStoreTitle.setPosition(x, y);

    x += pitch;
    for (Resource r : resources) {
      // Retreiving data
      inStore = GameData.getSelectedColony().getResource(r);
      max = GameData.getSelectedColony().getStorSpace(r);
      final int availableSpace = max.subtract(inStore).intValue();

      UIHelper.drawDarkBox(g, x + padding, oy + padding, 24, 20);
      img = ImageManager.getGfx(r.getGfxBase() + "-small");
      img.draw(x + padding + 2, oy + padding);
      // Creating and rendering the progress bar
      pb = this.resourceBars.get(r);
      pb.setX(x + padding + 24);
      pb.setY(oy + padding);
      pb.setMaxValue(max);
      pb.setValue(inStore);
      pb.render(g);

      // Rendering the resource amount, max and modifier
      if (this.extendedResourceDisplay) {
        y = oy + 25;
View Full Code Here

TOP

Related Classes of com.drakulo.games.ais.ui.component.ProgressBar

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.