private void updateSmartShape(int x, int y) {

		switch (actionID) {

		case SCIR_ID:
		case RCIR_ID:
			if (smartShape instanceof Ellipse) {
				Ellipse e = (Ellipse) smartShape;
				if (x > e.getX0()) {
					e.width = x - e.getX0();
					e.x = e.getX0();
				} else {
					e.width = e.getX0() - x;
					e.x = e.getX0() - e.width;
				}
				if (y > e.getY0()) {
					e.height = y - e.getY0();
					e.y = e.getY0();
				} else {
					e.height = e.getY0() - y;
					e.y = e.getY0() - e.height;
				}
			}
			break;

		case SREC_ID:
		case RREC_ID:
			if (smartShape instanceof RoundRectangle) {
				RoundRectangle rr = (RoundRectangle) smartShape;
				if (x > rr.getX0()) {
					rr.width = x - rr.getX0();
					rr.x = rr.getX0();
				} else {
					rr.width = rr.getX0() - x;
					rr.x = rr.getX0() - rr.width;
				}
				if (y > rr.getY0()) {
					rr.height = y - rr.getY0();
					rr.y = rr.getY0();
				} else {
					rr.height = rr.getY0() - y;
					rr.y = rr.getY0() - rr.height;
				}
			}
			break;

		case SFRE_ID:
			if (smartPoly == null)
				return;
			int n = smartPoly.npoints;
			if (n == 0)
				return;
			if (smartShape instanceof GeneralPath) {
				((GeneralPath) smartShape).reset();
			} else {
				smartShape = new GeneralPath();
			}
			((GeneralPath) smartShape).moveTo(smartPoly.xpoints[0], smartPoly.ypoints[0]);
			for (int i = 1; i < smartPoly.npoints; i++) {
				((GeneralPath) smartShape).lineTo(smartPoly.xpoints[i], smartPoly.ypoints[i]);
			}
			((GeneralPath) smartShape).lineTo(x, y);
			break;

		case SCUR_ID:
		case RCUR_ID:
			if (smartPoly == null)
				return;
			n = smartPoly.npoints;
			if (n == 0)
				return;
			if (smartShape instanceof GeneralPath) {
				((GeneralPath) smartShape).reset();
			} else {
				smartShape = new GeneralPath();
			}
			if (n == 1) {
				((GeneralPath) smartShape).moveTo(smartPoly.xpoints[0], smartPoly.ypoints[0]);
				((GeneralPath) smartShape).lineTo(x, y);
			} else {
				Polygon tempPoly = new Polygon();
				for (int i = 0; i < smartPoly.npoints; i++) {
					tempPoly.addPoint(smartPoly.xpoints[i], smartPoly.ypoints[i]);
				}
				tempPoly.addPoint(x, y);
				if (actionID == SCUR_ID) {
					CurvedSurface.createSpline(tempPoly, (GeneralPath) smartShape, 50, true);
				} else if (actionID == RCUR_ID) {
					CurvedRibbon.createSpline(tempPoly, (GeneralPath) smartShape, 50, false);
				}
			}
			break;

		}

	}