boolean handleMousePressed(int x, int y) {
		if (selectedComponent instanceof LineComponent) {
			LineComponent lc = (LineComponent) selectedComponent;
			int i = lc.nearEndPoint(x, y);
			lc.setSelectedEndPoint(i);
			lc.storeCurrentState();
			return i > 0;
		} else if (selectedComponent instanceof RectangleComponent) {
			RectangleComponent rc = (RectangleComponent) selectedComponent;
			byte i = rc.nearHandle(x, y);
			rc.setSelectedHandle(i);
			setAnchorPointForRectangularShape(i, rc.getX(), rc.getY(), rc.getWidth(), rc.getHeight());
			if (i >= 0)
				rc.storeCurrentState();
			return i >= 0;
		} else if (selectedComponent instanceof EllipseComponent) {
			EllipseComponent ec = (EllipseComponent) selectedComponent;
			byte i = ec.nearHandle(x, y);
			ec.setSelectedHandle(i);
			setAnchorPointForRectangularShape(i, ec.getX(), ec.getY(), ec.getWidth(), ec.getHeight());
			if (i >= 0)
				ec.storeCurrentState();
			return i >= 0;
		} else if (selectedComponent instanceof TriangleComponent) {
			TriangleComponent tc = (TriangleComponent) selectedComponent;
			byte i = tc.nearHandle(x, y);
			tc.setSelectedHandle(i);
			Rectangle rt = tc.getBounds();
			setAnchorPointForRectangularShape(i, rt.x, rt.y, rt.width, rt.height);
			if (i >= 0)
				tc.storeCurrentState();
			return i >= 0;
		}
		return false;
	}