ProgressBar pb = this.resourceBars.get(r);
pb.update(input);
}
// Handling research buttons
ResearchAction action = GameData.getSelectedColony().getResearch();
if (action == null) {
// No research for now : authorize start research is research is
// possible
if (this.uiTechnology != null
&& this.uiTechnology.getTechnology().isResearchable()) {
// The technology is researchable
this.startResearchButton.enable();
} else {
// Action not possible
this.startResearchButton.disable();
}
this.cancelResearchButton.disable();
this.researchProgress.setValue(BigDecimal.ZERO);
} else {
// Research in progress
Technology t = action.getTechnology();
if (this.uiTechnology == null) {
// The player is showing the root : disable all
this.startResearchButton.disable();
this.cancelResearchButton.disable();
} else if (t.equals(this.uiTechnology.getTechnology())) {
// The player is showing the research in pregress : authorize
// stop button
this.startResearchButton.disable();
this.cancelResearchButton.enable();
} else {
// The player is showing a random technology : block research
// actions
this.startResearchButton.disable();
this.cancelResearchButton.disable();
}
this.researchProgress.setValue(BigDecimal.valueOf(action
.getProgression()));
}
// buttons
this.startResearchButton.update(input);