title: Copy polygon to new location
body: <p>How can I copy a polygon to a new location. I use <code>e.isPopupTrigger()</code> to select the polygon, but I dont know how to copy it. Is the function of copy similar to the function of translate?
  e.g. polygon.translate(x,y)?</p>
  
  <p>Thanks.</p>
  
  <p>EDITED:</p>
  
  <p>//this code doesnt work :-(</p>
  
  <pre><code>if(e.getSource() == Copy){  
    Polygon copyPolygon = new Polygon();
    copyPolygon = selectedTriangle;
    copyPolygon.translate(2, 2);
    repaint();
  }
  </code></pre>
  
  <p>The problem has been solved with these code :-)</p>
  
  <pre><code>if(e.getSource() == Copy){    
    Polygon copyPolygon = new Polygon(selectedTriangle.xpoints,selectedTriangle.ypoints,selectedTriangle.npoints);
    copyPolygon.translate(10,10);
    triangles.add(copyPolygon);
    repaint();
  }           
  </code></pre>