Exemplo n.º 1
0
 public FarmingGraphPage(final FarmStrategy farmStrategy) {
   this.farmStrategy = farmStrategy;
   add(new Label("strategyName", farmStrategy.getStrategyName()));
   add(
       ArmoryImage.createArmoryImage(
           (AuctioneerWebApp) getApplication(), "icon", farmStrategy.getIconItem()));
 }
Exemplo n.º 2
0
  public FarmingGraphPage(PageParameters parameters) throws Exception {
    final int farmStrategyID = parameters.getInt("farmStrategyID");
    farmStrategy = farmStrategyBO.getById(FarmStrategyId.farmStrategyId(farmStrategyID));
    add(new Label("strategyName", farmStrategy.getStrategyName()));
    add(
        ArmoryImage.createArmoryImage(
            (AuctioneerWebApp) getApplication(), "icon", farmStrategy.getIconItem()));
    setPageTitle("Farming - " + farmStrategy.getStrategyName());

    final PropertyModel<List<FarmStrategyLoot>> materialListModel =
        new PropertyModel<List<FarmStrategyLoot>>(this, "farmStrategy.loot");

    ListView<FarmStrategyLoot> listView =
        new ListView<FarmStrategyLoot>("lootList", materialListModel) {
          private static final long serialVersionUID = 1L;

          @Override
          protected void populateItem(ListItem<FarmStrategyLoot> item) {

            final FarmStrategyLoot loot = item.getModelObject();
            PageParameters params = new PageParameters();
            params.add("itemID", String.valueOf(loot.getItem().getArmoryId().toInt()));
            final Link<String> lootLine =
                new BookmarkablePageLink<String>("lootLine", PriceWatchGraphPage.class, params);

            lootLine.add(new WowheadTooltip(loot.getItem().getArmoryId()));
            lootLine.add(
                ArmoryImage.createArmoryImage(
                    (AuctioneerWebApp) getApplication(), "icon", loot.getItem()));
            final String name = loot.getItemCount() + " x " + loot.getItem().getItemName();
            lootLine.add(new Label("name", name));
            item.add(lootLine);
          }
        };
    listView.setReuseItems(true);
    listView.setOutputMarkupId(true);
    add(listView);

    add(new Label("minProfit", goldToString(farmStrategy.getTotalSafeProfit())));
    add(new Label("medianProfit", goldToString(farmStrategy.getTotalProfit())));
  }