My dice simulator varies its UI depending on the user's input and the model. I have been trying to implement the Builder pattern to handle the variation and optional parameters, while allowing for the use of GroupLayout.
At the moment I am making a call like this in the Controller:
if ((model.simRolls <> null) && (inputEvent.getSource == outputBtn) && (model.testType.equals("Success"))) {
SimView outputScreen = new SimView.Builder(jframe, jpanel).testLabel("SUCCESS TEST OUTPUT", GroupAlignment.LEADING).outputLabel(model.simRolls, GroupAlignment.CENTER).actionButton("Next", GroupAlignment.TRAILING).build();
}
I hate the if statements because they are infinite in variety. Can anyone please help me understand what abstraction or contract or interface I can possibly use to cleanly and accurately build the required UI in the MVC?