public synchronized Rectangle getCorner(int position) {
		
		// calculate the coordinates for the inner square (x1,y1), (x2,y1), (x2,y2), (x1,y2)
		Rectangle bounds = this.region.getBounds();
		int x1 = bounds.x + borderWidth;
		int x2 = bounds.x + bounds.width - borderWidth;

		int y1 = bounds.y + borderWidth;
		int y2 = bounds.y + bounds.height - borderWidth;
		
		// the sizes of the inner square
		int width = bounds.width - (2 * borderWidth);
		int height = bounds.height - (2 * borderWidth);

		switch (position) {
		case TOP | LEFT | CORNER:
			return new Rectangle(bounds.x, bounds.y, borderWidth, borderWidth);
		case TOP | RIGHT | CORNER:
			return new Rectangle(x2, bounds.y, borderWidth, borderWidth);
		case BOTTOM | RIGHT | CORNER:
			return new Rectangle(x2, y2, borderWidth, borderWidth);
		case BOTTOM | LEFT  | CORNER:
			return new Rectangle(bounds.x, y2, borderWidth, borderWidth);
		case TOP:
			return new Rectangle(x1, bounds.y, width, borderWidth);
		case RIGHT:
			return new Rectangle(x2, y1, borderWidth, height);
		case BOTTOM:
			return new Rectangle(x1, y2, width, borderWidth);
		case LEFT:
			return new Rectangle(bounds.x, y1, borderWidth, height);
		} 
		return null;
	}