ConsoleController.java 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. package ui.controller;
  2. import java.awt.Color;
  3. import ui.model.Model;
  4. /**
  5. * Controller for the Canvas.
  6. *
  7. * @author Gruppe14
  8. */
  9. public class ConsoleController {
  10. private Model model;
  11. /**
  12. * Constructor.
  13. *
  14. * @param model
  15. * the Model
  16. */
  17. public ConsoleController(Model model) {
  18. this.model = model;
  19. }
  20. /**
  21. * Print Text on the console.
  22. *
  23. * @param text
  24. * String the Text
  25. * @param color
  26. * the color of the Text
  27. * @param p
  28. * size of the Text
  29. * @param bold
  30. * bold or not
  31. * @param italic
  32. * italic or not
  33. * @param nl
  34. * new line or not
  35. *
  36. **/
  37. public void addTextToConsole(String text, Color color, int p, boolean bold, boolean italic, boolean nl) {
  38. model.getConsole().addText(text, color, p, bold, italic, nl);
  39. }
  40. /**
  41. * Print Text on the console in black and font size 12.
  42. *
  43. * @param text
  44. * String the Text
  45. */
  46. public void addTextToConsole(String text) {
  47. model.getConsole().addText(text);
  48. }
  49. /**
  50. * Clears the console.
  51. */
  52. public void clearConsole() {
  53. model.getConsole().clearConsole();
  54. }
  55. }