title: JGraphX Moving cells and keeping edges
body: <p>I try to move a graph in JGraphX. My first try was to use setGeometry, but this moves also the entire coordinate system and its origin. So this is no option for me, because it is a bit tricky when moving several graphs.</p>
  
  <p>My second try with</p>
  
  <pre><code>Object[] ver = graph.getChildVertices(graph.getDefaultParent());
  graph.moveCells(ver, 100, 100, false);
  </code></pre>
  
  <p>moves all cells. So far so good, but the edges start and end points change its positions. </p>
  
  <p>After moving the cells:</p>
  
  <p><a href="https://i.stack.imgur.com/2b4hc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2b4hc.png" alt="After"></a></p>
  
  <p>Before moving the cells, the edges have the correct position.</p>
  
  <p><a href="https://i.stack.imgur.com/WxyEI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WxyEI.png" alt="Before"></a></p>
  
  <p>So how can I set the position of edges back to their normal start and endpoints?
  Alternatively, I appreciate any other approach to move cells to a given position.</p>
  
  <p><strong>EDIT: It seems like this behaviour only occurs, if I add a layout before. Without a layout, moving cells works as expected.</strong></p>
  
  <pre><code>mxGraph graph = new mxGraph();
      Object parent = graph.getDefaultParent();
  
      graph.getModel().beginUpdate();
      try
      {
          Object v1 = graph.insertVertex(parent, null, "Hello", 20, 20, 80,
                  30);
          Object v2 = graph.insertVertex(parent, null, "World!", 240, 150,
                  80, 30);
          graph.insertEdge(parent, null, "Edge", v1, v2);
  
  
      }
      finally
      {
          graph.getModel().endUpdate();
      }
      new mxHierarchicalLayout(graph).execute(graph.getDefaultParent());
      graph.getModel().beginUpdate();
      try
      {
          Object[] ver = graph.getChildVertices(graph.getDefaultParent());
          graph.moveCells(ver, 100, 100, false);
      }
      finally
      {
          graph.getModel().endUpdate();
      }
      mxGraphComponent graphComponent = new mxGraphComponent(graph);
      getContentPane().add(graphComponent);
  </code></pre>