Skip to content

Commit 37605b1

Browse files
committed
Minor refactor
1 parent e2fd7ae commit 37605b1

File tree

1 file changed

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

1 file changed

+11
-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: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -191,27 +191,25 @@ private void clearExistingTimeRegimeViews() {
191191
* @param method the new calculation method
192192
*/
193193
private void setCalculationMethod(final CalculationMethod method) {
194-
195194
viewModel.setCalculationMethod(method);
196-
System.out.println("hello I am in the code");
197-
try {
198-
Display.getDefault().syncExec(new Runnable(){
195+
updateCalculationMethod();
196+
}
197+
198+
private void updateCalculationMethod() {
199+
Display.getDefault().asyncExec(new Runnable(){
199200
@Override
200201
public void run() {
201-
System.out.println("im in the codez");
202-
radioSpecifyParameters.setSelection(viewModel.getCalculationMethod() == CalculationMethod.SPECIFY_PARAMETERS);
203-
radioUseTCBFile.setSelection(viewModel.getCalculationMethod() == CalculationMethod.USE_TCB_FILE);
202+
203+
final CalculationMethod method = viewModel.getCalculationMethod();
204+
205+
radioSpecifyParameters.setSelection(method == CalculationMethod.SPECIFY_PARAMETERS);
206+
radioUseTCBFile.setSelection(method == CalculationMethod.USE_TCB_FILE);
204207

205-
stack.topControl = viewModel.getCalculationMethod() == CalculationMethod.USE_TCB_FILE ? tcbFilePanel : tcbSettingsSwitchPanel;
208+
stack.topControl = method == CalculationMethod.USE_TCB_FILE ? tcbFilePanel : timeRegimesPanel;
206209

207210
tcbSettingsSwitchPanel.layout();
208-
System.out.println("finish da codez");
209211
}
210212
});
211-
} catch (Throwable t) {
212-
t.printStackTrace();
213-
}
214-
215213
}
216214

217215
@SuppressWarnings("checkstyle:magicnumber")

0 commit comments

Comments
 (0)