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

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


  @Override
  public void initState() throws SlickException {
    List<Technology> rootTechs = TechnologyHelper.getRootTechnologies();
    for (Technology t : rootTechs) {
      UITechnology uit = new UITechnology(t);
      this.roots.add(uit);
      add(uit);
    }

    this.background = ImageManager.getGfx("space_background");
View Full Code Here


    final int x = Settings.WIDTH / 2 - UITechnology.SIZE / 2;
    final int avs = Settings.HEIGHT - TOPBAR_HEIGHT - DATA_ZONE_HEIGHT;
    final int zoneHeight = avs / 2;
    int y = TOPBAR_HEIGHT + zoneHeight - UITechnology.SIZE / 2;

    this.uiTechnology = new UITechnology(t);
    this.uiTechnology.setPosition(x, y);
    this.uiTechnology.setSelected(true);

    this.children.clear();
    this.children.addAll(createUITechnologies(t.getChildren(), x + pitch));

    this.parents.clear();
    this.parents.addAll(createUITechnologies(t.getParents(), x - pitch));
    if (this.parents.isEmpty()) {
      // There is no parent so it is a root technology. We add a link to
      // show all roots technologies
      UITechnology root = new UITechnology("share");
      root.setPosition(x - pitch, y);
      this.parents.add(root);
    }
  }
View Full Code Here

    final int avs = Settings.HEIGHT - TOPBAR_HEIGHT - DATA_ZONE_HEIGHT;
    final int zones = technologies.size() + 1;
    final int zoneHeight = avs / zones;
    int y = TOPBAR_HEIGHT + zoneHeight - UITechnology.SIZE / 2;
    for (Technology t : technologies) {
      UITechnology uit = new UITechnology(t);
      uit.setPosition(x, y);
      result.add(uit);
      add(uit);
      y += zoneHeight;
    }
    add(uiTechnology);
View Full Code Here

TOP

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

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.