private void adjustBonusPointsOverview( ILabelledAlotmentView alotmentView, int currentValue, int maxValue) { alotmentView.setValue(Math.min(currentValue, maxValue)); alotmentView.setAlotment(maxValue); ValueLegalityState state = currentValue > maxValue ? ValueLegalityState.Increased : ValueLegalityState.Okay; alotmentView.setFontStyle(new LegalityFontProvider().getFontStyle(state)); }
private void adjustTotalOverview( ILabelledAlotmentView alotmentView, int currentValue, int maxValue) { alotmentView.setValue(currentValue); alotmentView.setAlotment(maxValue); ValueLegalityState state = currentValue > maxValue ? ValueLegalityState.High : ValueLegalityState.Okay; alotmentView.setTextColor(new LegalityColorProvider().getTextColor(state)); }
private void calculateXPCost() { for (IOverviewSubPresenter presenter : presenters) { presenter.update(); } totalView.setAlotment(getTotalXP()); setTotalViewColor(); totalView.setValue(management.getTotalCosts()); setTotalViewColor(); }
private void setTotalViewColor() { boolean overspent = management.getTotalCosts() > getTotalXP(); totalView.setTextColor( overspent ? LegalityColorProvider.COLOR_HIGH : LegalityColorProvider.COLOR_OKAY); }