public void setEndPoints(int x1, int x2, int y1, int y2) {
		colourize();
		switch (type) {
		case LINE:
			setStartingPoint(new Point(x1,y1));
			setEndPoint(new Point(x2,y2));
			break;
		case CIRCLE:
		case SQUARE:
			if (x2>=x1 && y2>=y1) {
				setStartingPoint(new Point(x1, y1));
				int side = Math.min(x2-x1, y2-y1);
				setEndPoint(new Point(x1 + side, y1 + side));
			}
			else if (x1>x2 && y2>y1) {
				int side = Math.min(x1-x2, y2-y1);
				setStartingPoint(new Point(x1-side,y1));
				setEndPoint(new Point(x1, y1+side));
			}
			else if (x2>x1 && y1>y2) {
				int side = Math.min(x2-x1, y1-y2);
				setStartingPoint(new Point(x1,y1 - side));
				setEndPoint(new Point(x1 + side, y1));
			}
			else { //x1>=x2 && y1>=y2
				int side = Math.min(x1 - x2, y1 - y2);
				setStartingPoint(new Point(x1 - side, y1 - side));
				setEndPoint(new Point(x1, y1));
			}
			break;
		default:
			setStartingPoint(new Point(Math.min(x1, x2), Math.min(y1, y2)));
			setEndPoint(new Point(Math.max(x2, x1), Math.max(y2, y1)));
			break;
		}
	}