Ejemplo n.º 1
0
 private void CreateNewFigureInCreateFigureMode(MotionEvent motionEvent) {
   if (((createShape.getClass()) == (Line.class))) {
     ((Line) createShape).getPoint1().setX(motionEvent.getX());
     ((Line) createShape).getPoint1().setY(motionEvent.getY());
     ((Line) createShape).getPoint2().setX(motionEvent.getX());
     ((Line) createShape).getPoint2().setY(motionEvent.getY());
   } else if (((createShape.getClass()) == (EndlessLine.class))) {
     //            ((EndlessLine) createShape).getPoint1().setX(motionEvent.getX()-100);
     //            ((EndlessLine) createShape).getPoint1().setY(motionEvent.getY()-100);
     //            ((EndlessLine) createShape).getPoint2().setX(motionEvent.getX()+100);
     //            ((EndlessLine) createShape).getPoint2().setY(motionEvent.getY()+100);
   } else if (((createShape.getClass()) == (Circle.class))) {
     ((Circle) createShape).getCoordinatesOfCenterPoint().setX(motionEvent.getX());
     ((Circle) createShape).getCoordinatesOfCenterPoint().setY(motionEvent.getY());
   } else if (((createShape.getClass()) == (Dot.class))) {
     ((Dot) createShape).getCoordinatesPoint().setX(motionEvent.getX());
     ((Dot) createShape).getCoordinatesPoint().setY(motionEvent.getY());
   }
   ShapeList listOfShapes = new ShapeList(createShape);
   addShape(listOfShapes);
   isTouchedShape = true;
   createFigureMode = false;
 }