private void updateOtherTimer() { Label condTimerLabel = this.main.getCondTimerLabel(); Text condTimerText = this.main.getCondTimerTime(); CondTiming timing = GlobalContext.getCondTiming(); Date nextUpdateTime = timing.getNextUpdateTime(this.now); // 疲労のある艦娘はいる? boolean needTimer = false; for (ShipDto ship : GlobalContext.getShipMap().values()) { if (ship.getCond() < 49) { needTimer = true; break; } } if (needTimer == false) { condTimerLabel.setText(""); condTimerText.setToolTipText(null); condTimerText.setText(""); } else if (nextUpdateTime == null) { condTimerLabel.setText("次の疲労回復まで"); condTimerText.setToolTipText("十分な情報がありません"); condTimerText.setText("???"); } else { int accuracy = (int) timing.getCurrentAccuracy() / 2000; condTimerLabel.setText("次の疲労回復まで(±" + accuracy + "秒)"); long rest = TimeLogic.getRest(this.now, nextUpdateTime); // ツールチップテキストで時刻を表示する condTimerText.setToolTipText(this.format.format(nextUpdateTime)); condTimerText.setText(TimeLogic.toDateRestString(rest, true)); } // 泊地修理タイマー Label akashiTimerLabel = this.main.getAkashiTimerLabel(); Text akashiTimerText = this.main.getAkashiTimerTime(); AkashiTimer akashiTimer = GlobalContext.getAkashiTimer(); if (akashiTimer.getStartTime() == null) { // 不明 akashiTimerText.setText("???"); akashiTimerText.setToolTipText("十分な情報がありません"); akashiTimerText.setBackground(ColorManager.getColor(SWT.COLOR_WHITE)); } else { long elapsed = this.now.getTime() - akashiTimer.getStartTime().getTime(); String time = TimeLogic.toDateRestString(elapsed / 1000, true); akashiTimerText.setText(time); akashiTimerText.setToolTipText(null); akashiTimerText.setBackground(ColorManager.getColor(AppConstants.AKASHI_REPAIR_COLOR)); } }
/** * 所有艦娘一覧の内容 * * @param specdiff 成長余地 * @param filter 鍵付きのみ * @return 内容 */ public static List<String[]> getShipListBody(boolean specdiff, ShipFilterDto filter) { Set<Entry<Long, ShipDto>> ships = ShipContext.get().entrySet(); List<Object[]> body = new ArrayList<Object[]>(); int count = 0; for (Entry<Long, ShipDto> entry : ships) { ShipDto ship = entry.getValue(); if ((filter != null) && !ShipFilterLogic.shipFilter(ship, filter)) { continue; } count++; if (!specdiff) { // 通常 body.add( new Object[] { count, ship.getId(), ship.getFleetid(), ship.getName(), ship.getType(), ship.getCond(), ship.getCondClearDateString(), ship.getLv(), ship.getNext(), ship.getExp(), ship.getSallyArea().getName(), ship.getSeiku(), ship.getSlot().get(0), ship.getSlot().get(1), ship.getSlot().get(2), ship.getSlot().get(3), ship.getSlot().get(5), ship.getMaxhp(), ship.getKaryoku(), ship.getRaisou(), ship.getTaiku(), ship.getSoukou(), ship.getKaihi(), ship.getTaisen(), ship.getSakuteki(), ship.getLucky(), ship.getAccuracy(), ship.getHougekiPower(), ship.getRaigekiPower(), ship.getTaisenPower(), ship.getYasenPower() }); } else { // 成長の余地 // 火力 long karyoku = ship.getKaryokuMax() - ship.getKaryoku(); // 雷装 long raisou = ship.getRaisouMax() - ship.getRaisou(); // 対空 long taiku = ship.getTaikuMax() - ship.getTaiku(); // 装甲 long soukou = ship.getSoukouMax() - ship.getSoukou(); // 回避 long kaihi = ship.getKaihiMax() - ship.getKaihi(); // 対潜 long taisen = ship.getTaisenMax() - ship.getTaisen(); // 索敵 long sakuteki = ship.getSakutekiMax() - ship.getSakuteki(); // 運 long lucky = ship.getLuckyMax() - ship.getLucky(); for (ItemDto item : ship.getItem()) { if (item != null) { karyoku += item.getHoug(); raisou += item.getRaig(); taiku += item.getTyku(); soukou += item.getSouk(); kaihi += item.getHouk(); taisen += item.getTais(); sakuteki += item.getSaku(); lucky += item.getLuck(); } } body.add( new Object[] { count, ship.getId(), ship.getFleetid(), ship.getName(), ship.getType(), ship.getCond(), ship.getCondClearDateString(), ship.getLv(), ship.getNext(), ship.getExp(), ship.getSallyArea().getName(), ship.getSeiku(), ship.getSlot().get(0), ship.getSlot().get(1), ship.getSlot().get(2), ship.getSlot().get(3), ship.getSlot().get(5), ship.getMaxhp(), karyoku, raisou, taiku, soukou, kaihi, taisen, sakuteki, lucky, ship.getAccuracy(), ship.getHougekiPower(), ship.getRaigekiPower(), ship.getTaisenPower(), ship.getYasenPower() }); } } return toListStringArray(body); }