title: Javafx 8 drawing a line between translated nodes
body: <p>How do you draw a line between the centers of translated nodes? Given for example the following code snippet:</p>
  
  <pre><code>public class Test extends Application{
      @Override
      public void start(Stage primaryStage) {
          StackPane root = new StackPane();
  
          Circle circle1=new Circle(10, Color.GREEN);
          root.getChildren().add(circle1);
          Circle circle2=new Circle(10, Color.RED);
          root.getChildren().add(circle2);
  
          Scene scene = new Scene(root, 300, 250);
          primaryStage.setScene(scene);
          primaryStage.show();
  
          circle1.setTranslateX(100);
  
          Line line=new Line(circle1.getCenterX(), circle1.getCenterY(), circle2.getCenterX(), circle2.getCenterY());
          root.getChildren().add(line);
      }
      public static void main(String[] args) {
          launch(args);
      }
  }
  </code></pre>
  
  <p>Running this application will clearly show a red and a green circle. However, there won't be a line because each of the centers of the circles are at the coordinates (0,0). Nevertheless, the circles do not cover each other because one of the circles is translated. This doesn't work:</p>
  
  <pre><code>Line line=new Line(circle1.getCenterX()+circle1.getTranslateX(), circle1.getCenterY()+circle1.getTranslateY(), circle2.getCenterX()+circle2.getTranslateX(), circle2.getCenterY()+circle2.getTranslateY());
  </code></pre>
  
  <p>Finally, let's assume that there is an approach to draw a line connecting the centers of the two circles. If, after the line is drawn, I would invoke <code>circle2.setTranslateX(50);</code>, how do I ensure that the endpoint of the line  on the side of circle2 moves accordingly?</p>