boolean handleMouseDragged(int x, int y) {
		if (!isEditable() && selectedComponent != null && !selectedComponent.isDraggable())
			return false;
		if (selectedComponent instanceof LineComponent) {
			LineComponent lc = (LineComponent) selectedComponent;
			boolean b = false;
			switch (lc.getSelectedEndPoint()) {
			case 1:
				lc.setEndPoint1(x, y);
				b = true;
				break;
			case 2:
				lc.setEndPoint2(x, y);
				b = true;
				break;
			}
			if (b) {
				repaint();
				getModel().notifyChange();
				if (!doNotFireUndoEvent) {
					getModel().getUndoManager().undoableEditHappened(new UndoableEditEvent(getModel(), new UndoableLayeredComponentOperation(UndoAction.RESIZE_LINE, lc)));
					updateUndoUIComponents();
				}
				return true;
			}
		} else if (selectedComponent instanceof RectangleComponent) {
			RectangleComponent rc = (RectangleComponent) selectedComponent;
			if (rc.getSelectedHandle() >= 0) {
				switch (rc.getSelectedHandle()) {
				case RectangleComponent.LOWER_LEFT:
				case RectangleComponent.LOWER_RIGHT:
				case RectangleComponent.UPPER_LEFT:
				case RectangleComponent.UPPER_RIGHT:
					rc.setRect(Math.min(x, anchorPoint.x), Math.min(y, anchorPoint.y), Math.abs(x - anchorPoint.x), Math.abs(y - anchorPoint.y));
					break;
				case RectangleComponent.TOP:
				case RectangleComponent.BOTTOM:
					rc.setY(Math.min(y, anchorPoint.y));
					rc.setHeight(Math.abs(y - anchorPoint.y));
					break;
				case RectangleComponent.LEFT:
				case RectangleComponent.RIGHT:
					rc.setX(Math.min(x, anchorPoint.x));
					rc.setWidth(Math.abs(x - anchorPoint.x));
					break;
				case RectangleComponent.ARC_HANDLE:
					float arc = x - rc.getX();
					if (arc < 0)
						arc = 0;
					else
						arc = Math.min(arc, 0.5f * Math.min(rc.getWidth(), rc.getHeight()));
					rc.setArcWidth(2 * arc);
					rc.setArcHeight(2 * arc);
					break;
				}
				repaint();
				getModel().notifyChange();
				if (!doNotFireUndoEvent) {
					getModel().getUndoManager().undoableEditHappened(new UndoableEditEvent(getModel(), new UndoableLayeredComponentOperation(UndoAction.RESIZE_RECTANGLE, rc)));
					updateUndoUIComponents();
				}
				return true;
			}
		} else if (selectedComponent instanceof EllipseComponent) {
			EllipseComponent ec = (EllipseComponent) selectedComponent;
			if (ec.getSelectedHandle() >= 0) {
				switch (ec.getSelectedHandle()) {
				case RectangleComponent.LOWER_LEFT:
				case RectangleComponent.LOWER_RIGHT:
				case RectangleComponent.UPPER_LEFT:
				case RectangleComponent.UPPER_RIGHT:
					ec.setOval(Math.min(x, anchorPoint.x), Math.min(y, anchorPoint.y), Math.abs(x - anchorPoint.x), Math.abs(y - anchorPoint.y));
					break;
				case RectangleComponent.TOP:
				case RectangleComponent.BOTTOM:
					ec.setY(Math.min(y, anchorPoint.y));
					ec.setHeight(Math.abs(y - anchorPoint.y));
					break;
				case RectangleComponent.LEFT:
				case RectangleComponent.RIGHT:
					ec.setX(Math.min(x, anchorPoint.x));
					ec.setWidth(Math.abs(x - anchorPoint.x));
					break;
				}
				repaint();
				getModel().notifyChange();
				if (!doNotFireUndoEvent) {
					getModel().getUndoManager().undoableEditHappened(new UndoableEditEvent(getModel(), new UndoableLayeredComponentOperation(UndoAction.RESIZE_ELLIPSE, ec)));
					updateUndoUIComponents();
				}
				return true;
			}
		} else if (selectedComponent instanceof TriangleComponent) {
			TriangleComponent tc = (TriangleComponent) selectedComponent;
			byte i = tc.getSelectedHandle();
			if (i != -1) {
				tc.setVertex(i, x, y);
				repaint();
				getModel().notifyChange();
				if (!doNotFireUndoEvent) {
					getModel().getUndoManager().undoableEditHappened(new UndoableEditEvent(getModel(), new UndoableLayeredComponentOperation(UndoAction.RESIZE_TRIANGLE, tc)));
					updateUndoUIComponents();
				}
				return true;
			}
		}
		return false;
	}