123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- package ui.controller;
- import java.awt.Color;
- import ui.model.Model;
- import ui.view.StatisticGraphPanel;
- /**
- * Controller for the Global Variables.
- *
- * @author Gruppe14
- */
- public class GlobalController {
- private Model model;
- /**
- * Constructor.
- *
- * @param model
- * the Model
- */
- public GlobalController(Model model) {
- this.model = model;
- }
- /**
- * Returns SCALE.
- *
- * @return SCALE
- */
- public int getScale() {
- return model.getScale();
- }
- /**
- * Returns SCALE Divided by 2.
- *
- * @return SCALE Divided by 2
- */
- public int getScaleDiv2() {
- return model.getScaleDiv2();
- }
- /**
- * Changes the value of SCALE and SCALEDIV2.
- *
- * @param s
- * Scale
- */
- public void setScale(int s) {
- model.setScale(s);
- }
- /**
- * sets the current Iteration.
- *
- * @param curit
- * the current Iteration
- */
- public void setCurIteration(int curit) {
- model.setCurIteration(curit);
- }
- /**
- * Returns numberOfSaves.
- *
- * @return numberOfSaves
- */
- public int getNumbersOfSaves() {
- return model.getNumberOfSaves();
- }
- /**
- * sets the max number of autosaves.
- *
- * @param numberofSaves
- * the max number of autosaves
- */
- public void setNumberOfSaves(int numberofSaves) {
- model.setNumberOfSaves(numberofSaves);
- ;
- }
- /**
- * Set the timerSpeed.
- * @param t
- * Interval in ms
- */
- public void setTimerSpeed(int t) {
- model.setTimerSpeed(t);
- }
- /**
- * Set the Canvas X Size.
- *
- * @param canvasX the cANVAS_X to set
- */
- public void setCanvasX(int canvasX) {
- model.setCanvasX(canvasX);
- }
- /**
- * Set the Canvas Y Size.
- *
- * @param canvasY the cANVAS_Y to set
- */
- public void setCanvasY(int canvasY) {
- model.setCanvasY(canvasY);
- }
-
- /**
- * Add a SubNetColor.
- *
- * @param c
- * the Color
- */
- public void addSubNetColor(Color c) {
- model.addSubNetColor(c);
- }
-
-
- public void setMaxCapacity(float cap) {
- model.setMaxCapacity(cap);
- }
- /**
- * Changes the value of HolonBodySCALE
- *
- * @param s
- * HolonBodyScale
- */
- public void setHolonBodyScale(int s) {
- model.setHolonBodyScale(s);
- }
- /**
- * Returns HolonBodySCALE.
- *
- * @return HolonBodySCALE
- */
- public int getHolonBodyScale() {
- return model.getHolonBodyScale();
- }
-
- /**
- * Sets if the Simulation is running
- */
- public void setIsSimRunning(boolean isRunning){
- model.setIsSimRunning(isRunning);
- //Reset the Graph if isRunning == true
- if (isRunning) {
- for (StatisticGraphPanel sg : model.getGraphTable().values()) {
- sg.resetGraph();
- }
- }
- }
-
- /**
- * Sets showConsoleLog.
- * @param showConsoleLog
- */
- public void setShowConsoleLog(boolean showConsoleLog) {
- model.setShowConsoleLog(showConsoleLog);
- }
-
- /**
- * sets showSupplyBars
- * @param showSupplyBars
- */
- public void setShowSupplyBars(boolean showSupplyBars) {
- model.setShowSupplyBars(showSupplyBars);
- }
-
- /**
- * sets showSupplyBars
- * @param showSupplyBars
- */
- public void setFairnessModel(short fairnessModel) {
- model.setFairnessModel(fairnessModel);
- }
- }
|