@Override
	public void drawPreview(Graphics2D g) {// draws preview to canvas

		int minX = Math.min(startX, endX);
		int minY = Math.min(startY, endY);
		int maxX = Math.max(startX, endX);
		int maxY = Math.max(startY, endY);

		int width = maxX - minX;
		int height = maxY - minY;

		if (!canvas.getClear()) {

			canvas.setGraphicsDetails(g);

			switch (shape) {
			case "Draw Rectangle":
				g.drawRect(minX, minY, width, height);
				break;

			case "Fill Rectangle":
				g.fillRect(minX, minY, width, height);
				break;

			case "Draw Oval":
				g.drawOval(minX, minY, width, height);
				break;

			case "Fill Oval":
				g.fillOval(minX, minY, width, height);
				break;
			}
		} else {

			canvas.resetClear();

		}

	}