I wrote this code to animate a circle:
Circle animatedCircle = new Circle();
animatedCircle.setRadius(10);
animatedCircle.setFill(Color.YELLOW);
Path path = new Path();
path.getElements().add(new MoveTo(20,20));
path.getElements().add(new LineTo(50,50));
PathTransition transicion = new PathTransition();
transicion.setDuration(Duration.millis(1000));
transicion.setPath(path);
transicion.setNode(animatedCircle);
transicion.setOrientation(PathTransition.OrientationType.ORTHOGONAL_TO_TANGENT);
transicion.setCycleCount(Timeline.INDEFINITE);
transicion.play();
I need the path to keep the same color of the circle, so it actually draws a line, and then the line will stay. How to accomplish this idea? Or is there a better way to draw a permanent line with animations?