Skip to content

Commit 1ac4595

Browse files
Merge pull request #698 from ISISComputingGroup/Ticket3252_tcb
Ticket3252 tcb
2 parents fdc6f75 + e829af1 commit 1ac4595

File tree

1 file changed

+19
-13
lines changed
  • base/uk.ac.stfc.isis.ibex.ui.dae/src/uk/ac/stfc/isis/ibex/ui/dae/experimentsetup/timechannels

1 file changed

+19
-13
lines changed

base/uk.ac.stfc.isis.ibex.ui.dae/src/uk/ac/stfc/isis/ibex/ui/dae/experimentsetup/timechannels/TimeChannelsPanel.java

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -190,19 +190,26 @@ private void clearExistingTimeRegimeViews() {
190190
*
191191
* @param method the new calculation method
192192
*/
193-
private void setCalculationMethod(CalculationMethod method) {
193+
private void setCalculationMethod(final CalculationMethod method) {
194194
viewModel.setCalculationMethod(method);
195-
switch (method) {
196-
case USE_TCB_FILE:
197-
radioUseTCBFile.setSelection(true);
198-
stack.topControl = tcbFilePanel;
199-
break;
200-
case SPECIFY_PARAMETERS:
201-
default:
202-
radioSpecifyParameters.setSelection(true);
203-
stack.topControl = timeRegimesPanel;
204-
break;
205-
}
195+
updateCalculationMethod();
196+
}
197+
198+
private void updateCalculationMethod() {
199+
Display.getDefault().asyncExec(new Runnable(){
200+
@Override
201+
public void run() {
202+
203+
final CalculationMethod method = viewModel.getCalculationMethod();
204+
205+
radioSpecifyParameters.setSelection(method == CalculationMethod.SPECIFY_PARAMETERS);
206+
radioUseTCBFile.setSelection(method == CalculationMethod.USE_TCB_FILE);
207+
208+
stack.topControl = method == CalculationMethod.USE_TCB_FILE ? tcbFilePanel : timeRegimesPanel;
209+
210+
tcbSettingsSwitchPanel.layout();
211+
}
212+
});
206213
}
207214

208215
@SuppressWarnings("checkstyle:magicnumber")
@@ -228,7 +235,6 @@ public void widgetSelected(SelectionEvent e) {
228235
} else {
229236
setCalculationMethod(CalculationMethod.SPECIFY_PARAMETERS);
230237
}
231-
tcbSettingsSwitchPanel.layout();
232238
}
233239
};
234240
radioSpecifyParameters.addSelectionListener(listener);

0 commit comments

Comments
 (0)