Skip to content
Snippets Groups Projects

#34 validate inputs in model classes

Merged Vetle Traran Bjørnøy requested to merge #34-Validate-inputs-in-model-classes into main
17 files
+ 257
80
Compare changes
  • Side-by-side
  • Inline
Files
17
package edu.ntnu.idatt2003.controller;
import edu.ntnu.idatt2003.exceptions.ChaosCanvasException;
import edu.ntnu.idatt2003.exceptions.ChaosGameDescriptionFactoryException;
import edu.ntnu.idatt2003.exceptions.ChaosGameException;
import edu.ntnu.idatt2003.model.game.ChaosGame;
import edu.ntnu.idatt2003.model.game.ChaosGameDescription;
import edu.ntnu.idatt2003.model.game.ChaosGameDescriptionFactory;
@@ -24,13 +27,15 @@ public class ChaosGameController implements Observer {
* @param width the width of the canvas.
* @param height the height of the canvas.
*/
public ChaosGameController(ViewCanvas viewCanvas, int width, int height) {
public ChaosGameController(ViewCanvas viewCanvas, int width, int height)
throws ChaosGameDescriptionFactoryException, ChaosGameException, ChaosCanvasException {
this.viewCanvas = viewCanvas;
chaosGame = new ChaosGame(ChaosGameDescriptionFactory.get("Julia Set"), width, height);
chaosGame.attach(this);
}
public void resetChaosGameWithDescription(String description) {
public void resetChaosGameWithDescription(String description)
throws ChaosGameDescriptionFactoryException, ChaosGameException {
ChaosGameDescription newDescription = ChaosGameDescriptionFactory.get(description);
chaosGame.resetGameWithDescription(newDescription);
}
Loading