Ejemplo n.º 1
0
  /**
   * 所有装備一覧の内容
   *
   * @return 内容
   */
  public static List<String[]> getItemListBody() {
    Set<Entry<Long, ItemDto>> items = ItemContext.get().entrySet();
    Map<ItemDto, Integer> itemCountMap = new HashMap<ItemDto, Integer>();

    for (Entry<Long, ItemDto> entry : items) {
      ItemDto item = entry.getValue();
      Integer count = itemCountMap.get(item);
      if (count == null) {
        count = 1;
      } else {
        count = count + 1;
      }
      itemCountMap.put(item, count);
    }

    List<Entry<ItemDto, Integer>> countitems =
        new ArrayList<Entry<ItemDto, Integer>>(itemCountMap.entrySet());
    Collections.sort(
        countitems,
        new Comparator<Entry<ItemDto, Integer>>() {
          @Override
          public int compare(Entry<ItemDto, Integer> o1, Entry<ItemDto, Integer> o2) {
            return o1.getValue().compareTo(o2.getValue());
          }
        });

    List<Object[]> body = new ArrayList<Object[]>();

    int count = 0;
    for (Entry<ItemDto, Integer> entry : countitems) {
      ItemDto item = entry.getKey();
      count++;
      body.add(
          new Object[] {
            count,
            item.getName(),
            item.getType(),
            entry.getValue(),
            item.getHoug(),
            item.getHoum(),
            item.getLeng(),
            item.getLuck(),
            item.getHouk(),
            item.getBaku(),
            item.getRaig(),
            item.getSaku(),
            item.getTais(),
            item.getTyku(),
            item.getSouk()
          });
    }
    return toListStringArray(body);
  }
Ejemplo n.º 2
0
 /**
  * 装備でフィルタ
  *
  * @param ship
  * @param filter
  */
 private static boolean itemFilter(ShipDto ship, ShipFilterDto filter) {
   List<ItemDto> item = ship.getItem();
   boolean hit = false;
   for (ItemDto itemDto : item) {
     if (itemDto != null) {
       if (filter.itemname.equals(itemDto.getName())) {
         hit = true;
         break;
       }
     }
   }
   if (!hit) {
     return false;
   }
   return true;
 }
Ejemplo n.º 3
0
 public void updateContents(ShipFilterDto filter, boolean panelVisible, boolean etcVisible) {
   this.changeEnabled = false;
   Set<String> items = new TreeSet<String>();
   for (ItemDto entry : GlobalContext.getItemMap().values()) {
     items.add(entry.getName());
   }
   this.nametext.remove(0, this.nametext.getItemCount() - 1);
   for (String name : items) {
     this.nametext.add(name);
   }
   this.recreateGroupButtons();
   this.recreateShipTypeButtonos();
   this.applyFilter(filter);
   this.setPanelVisible(panelVisible, etcVisible);
   this.changeEnabled = true;
 }