@Override
	public void initialize(URL arg0, ResourceBundle arg1) {
		/* Constructors */
		drawnGeometry = new ArrayList<Node>();
		mediatorList = new ArrayList<Mediator>();
		preferences = new HashMap<String, Preference>();
		undo = new Stack<Command>();
        redo = new Stack<Command>();
        cloneFactory = new CloneFactory();
		
		/* Initialize GUI, set values, create listeners */
		cbTools.getItems().addAll(TOOL_TYPES);
		sResize.setMax(200);
		
		setPreferences("draw");
		
        createListeners();
        resetValues();
        
        
        /* initialize colorpicker and canvas */
        colorPicker.setValue(Color.BEIGE);
        pColorPicker.getChildren().addAll(colorPicker);
        
        /* add eventListeners to canvas for: CLICKED and DRAGGED */
        pArtBoard.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {
			@Override
			public void handle(MouseEvent event) {
				double mouseX, mouseY;
				Command command = null;
				mouseX = event.getX();
				mouseY = event.getY();
				String curAction;
				
				/* get current action */
				curAction = preferences.get("action").getStringPreference();
				switch(curAction) {
				case "draw":
					switch(preferences.get("tool").getStringPreference()) 
					{
						case "Circle":
						case "Ellipse":
							EllipseShape newEllipse = new EllipseShape(everyShape);
							everyShape.add(newEllipse);
							command = new CreateEllipse(mouseX, mouseY, newEllipse, pArtBoard);
							break;
						case "Triangle":
							TriangleShape newTriangle = new TriangleShape();
							everyShape.add(newTriangle);
							command = new CreateTriangle(preferences, mouseX, mouseY, newTriangle, pArtBoard);
							break;
						case "Rectangle":
						case "Square":
							RectangleShape newRectangle = new RectangleShape();
							everyShape.add(newRectangle);
							command = new CreateRectangle(preferences, mouseX, mouseY, newRectangle, pArtBoard);
//							RectangleShape newRectangle = (RectangleShape) cloneFactory.getClone(rectanglePrototype);
							//command = new CreateRectangle(preferences, mouseX, mouseY, newRectangle, artBoard);
							break;
						case "Pencil":
							break;
					}
					command.execute();
					
					break;
				case "edit":
					//command = new EditShape(preferences, mouseX, mouseY);
					break;
				case "group":
					/*for(int i=0; i<drawnGeometry.size(); i++){
						System.out.println(drawnGeometry.get(i).getClass());
						String classString = drawnGeometry.get(i).getClass().toString();
						String[] splitArray;
						splitArray = classString.split(".");
						if(splitArray[1] == "EllipseShape"){
							drawnGeometry.get(i);
						}	
					}*/
					
					break;
				default:
					//just cleared or not set yet
					return;
				}
				putCmdOnStack(command);
			}
        });
	}