@Override
  public void actionPerformed(ActionEvent event) {
	Object source = event.getSource();
	int tmp = 0;
    if(source == line) {
      tmp = 0;
    }else if(source == curve) {
      tmp = 1;
    }else if(source == rectangle) {
      tmp = 2;
    }else if(source == oval) {
      tmp = 3;
    }else if(source == triangle) {
      tmp = 4;
    }else if(source == clear) {
      model.clearBoard();
      return;
    }else {
      throw new RuntimeException("Wrong source");
    }
    model.chooseBrush(tmp);
  }