GlobalController.java 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. package ui.controller;
  2. import java.awt.Color;
  3. import ui.model.Model;
  4. /**
  5. * Controller for the Global Variables.
  6. *
  7. * @author Gruppe14
  8. */
  9. public class GlobalController {
  10. private Model model;
  11. /**
  12. * Constructor.
  13. *
  14. * @param model
  15. * the Model
  16. */
  17. public GlobalController(Model model) {
  18. this.model = model;
  19. }
  20. /**
  21. * Returns SCALE.
  22. *
  23. * @return SCALE
  24. */
  25. public int getScale() {
  26. return model.getScale();
  27. }
  28. /**
  29. * Returns SCALE Divided by 2.
  30. *
  31. * @return SCALE Divided by 2
  32. */
  33. public int getScaleDiv2() {
  34. return model.getScaleDiv2();
  35. }
  36. /**
  37. * Changes the value of SCALE and SCALEDIV2.
  38. *
  39. * @param s
  40. * Scale
  41. */
  42. public void setScale(int s) {
  43. model.setScale(s);
  44. }
  45. /**
  46. * sets the current Iteration.
  47. *
  48. * @param curit
  49. * the current Iteration
  50. */
  51. public void setCurIteration(int curit) {
  52. model.setCurIteration(curit);
  53. }
  54. /**
  55. * Returns numberOfSaves.
  56. *
  57. * @return numberOfSaves
  58. */
  59. public int getNumbersOfSaves() {
  60. return model.getNumberOfSaves();
  61. }
  62. /**
  63. * sets the max number of autosaves.
  64. *
  65. * @param numberofSaves
  66. * the max number of autosaves
  67. */
  68. public void setNumberOfSaves(int numberofSaves) {
  69. model.setNumberOfSaves(numberofSaves);
  70. ;
  71. }
  72. /**
  73. * Set the timerSpeed.
  74. * @param t
  75. * Interval in ms
  76. */
  77. public void setTimerSpeed(int t) {
  78. model.setTimerSpeed(t);
  79. }
  80. /**
  81. * Set isSimulation.
  82. *
  83. * @param b
  84. * boolean for for isSimulation
  85. */
  86. public void setIsSimulation(boolean b) {
  87. model.setIsSimulation(b);
  88. }
  89. /**
  90. * Set the Canvas X Size.
  91. *
  92. * @param canvasX the cANVAS_X to set
  93. */
  94. public void setCanvasX(int canvasX) {
  95. model.setCanvasX(canvasX);
  96. }
  97. /**
  98. * Set the Canvas Y Size.
  99. *
  100. * @param canvasY the cANVAS_Y to set
  101. */
  102. public void setCanvasY(int canvasY) {
  103. model.setCanvasY(canvasY);
  104. }
  105. /**
  106. * Add a SubNetColor.
  107. *
  108. * @param c
  109. * the Color
  110. */
  111. public void addSubNetColor(Color c) {
  112. model.addSubNetColor(c);
  113. }
  114. public void setMaxCapacity(float cap) {
  115. model.setMaxCapacity(cap);
  116. }
  117. /**
  118. * Changes the value of HolonBodySCALE
  119. *
  120. * @param s
  121. * HolonBodyScale
  122. */
  123. public void setHolonBodyScale(int s) {
  124. model.setHolonBodyScale(s);
  125. }
  126. /**
  127. * Returns HolonBodySCALE.
  128. *
  129. * @return HolonBodySCALE
  130. */
  131. public int getHolonBodyScale() {
  132. return model.getHolonBodyScale();
  133. }
  134. }