2011-04-13 1 views
0

Java의 Line2D.Float를 사용하고 있습니다.Line2D를 재배치하십시오. Java

이 도형에 대해 일종의 끌어서 놓기를 수행하려고합니다.

이미 선택된 Line2D 객체를 얻었으므로 실제로 새 좌표로 이동하는 방법을 알아야합니다. 내가 주조를 추가 그 이유는,

((Line2D)selectedShape).setLocation(newX, newY);

selectedShape는 Shape 객체가

감사합니다

답변

1

뭔가 this 같은 :

나는 이런 식으로 뭔가를해야합니다..

void setLine(Point2D p1, Point2D p2) 

     Sets the location of the endpoints of this Line2D to the specified Point2D coordinates. 
관련 문제