private void calculateXPCost() { for (IOverviewSubPresenter presenter : presenters) { presenter.update(); } totalView.setAlotment(getTotalXP()); setTotalViewColor(); totalView.setValue(management.getTotalCosts()); setTotalViewColor(); }
@Override public void initPresentation() { IOverviewCategory category = view.addOverviewCategory(getString("Overview.Experience.Title")); for (IValueModel<Integer> model : management.getAllModels()) { IValueView<Integer> valueView = category.addIntegerValueView(getString("Overview.Experience." + model.getId()), 2); presenters.add(new ValueSubPresenter(model, valueView)); } initTotal(category); calculateXPCost(); }
private void setTotalViewColor() { boolean overspent = management.getTotalCosts() > getTotalXP(); totalView.setTextColor( overspent ? LegalityColorProvider.COLOR_HIGH : LegalityColorProvider.COLOR_OKAY); }
private int getTotalXP() { return character.getExperiencePoints().getTotalExperiencePoints() + management.getMiscGain(); }