package ui.controller;

import java.awt.Color;

import javax.swing.text.BadLocationException;
import javax.swing.text.StyleConstants;

import ui.model.Model;
import ui.view.Console;

/**
 * Controller for the Canvas.
 * 
 * @author Gruppe14
 */
public class ConsoleController {

	private Model model;

	/**
	 * Constructor.
	 * 
	 * @param model
	 *            the Model
	 */
	public ConsoleController(Model model) {
		this.model = model;
	}

	/**
	 * Print Text on the console.
	 *
	 * @param text
	 *            String the Text
	 * @param color
	 *            the color of the Text
	 * @param p
	 *            size of the Text
	 * @param bold
	 *            bold or not
	 * @param italic
	 *            italic or not
	 * @param nl
	 *            new line or not
	 * 
	 **/
	public void addTextToConsole(String text, Color color, int p, boolean bold, boolean italic, boolean nl) {
		model.getConsole().addText(text, color, p, bold, italic, nl);
	}

	/**
	 * Print Text on the console in black and font size 12.
	 *
	 * @param text
	 *            String the Text
	 */
	public void addTextToConsole(String text) {
		model.getConsole().addText(text);
	}

	/**
	 * Clears the console.
	 */
	public void clearConsole() {
		model.getConsole().clearConsole();
	}
}
