public void drag(DragContext dc) { Point3 qnew = _mouseOnPlane.getPoint(dc.getMouseEvent()); //BoxConstraint constraint = _frame.getBoxConstraint(); //if (constraint!=null && !constraint.containsPoint(qnew)) // return; if (this==_h[0]) { _frame.setCorners(qnew,_frame.getCorner(3)); } else if (this==_h[1]) { _frame.setCorners(qnew,_frame.getCorner(2)); } else if (this==_h[2]) { _frame.setCorners(qnew,_frame.getCorner(1)); } else if (this==_h[3]) { _frame.setCorners(qnew,_frame.getCorner(0)); } updateHandles(); } public void dragEnd(DragContext dc) {
private void updateHandles() { Point3 q0 = _frame.getCorner(0); Point3 q1 = _frame.getCorner(1); Point3 q2 = _frame.getCorner(2); Point3 q3 = _frame.getCorner(3); if (_h[0]==null) { _h[0] = new Handle(q0); _h[1] = new Handle(q1); _h[2] = new Handle(q2); _h[3] = new Handle(q3); } else { _h[0].setLocation(q0); _h[1].setLocation(q1); _h[2].setLocation(q2); _h[3].setLocation(q3); } }