/** * Sets the box constraint for this frame. Typically, only panels in a * frame call this method, because the constraint often depends on what * is drawn by those panels. This frame uses only the last constraint set. * @param constraint the box constraint. */ public void setBoxConstraint(BoxConstraint constraint) { _constraint = constraint; setCorners(_p[0],_p[3]); }
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) {
/** * Constructs a frame with specified axis and corner points. * @param axis the axis. * @param pa a corner point. * @param pb a corner point. */ public AxisAlignedFrame(Axis axis, Point3 pa, Point3 pb) { _axis = axis; setCorners(pa,pb); addChild(new Wire()); }
public void drag(DragContext dc) { assert _mouseConstrained!=null:"mouseConstrained!=null"; Point3 point = _mouseConstrained.getPoint(dc.getMouseEvent()); //BoxConstraint constraint = _frame.getBoxConstraint(); //if (constraint!=null && !constraint.containsPoint(point)) // return; Vector3 vector = point.minus(_origin); Point3 qa = _qa.plus(vector); Point3 qb = _qb.plus(vector); _frame.setCorners(qa,qb); updateHandles(); } public void dragEnd(DragContext dc) {
Axis axis = frame.getAxis(); if (axis==Axis.X) { frame.setCorners(new Point3(xk,fy,fz),new Point3(xk,ly,lz)); } else if (axis==Axis.Y) { frame.setCorners(new Point3(fx,yk,fz),new Point3(lx,yk,lz)); } else { frame.setCorners(new Point3(fx,fy,zk),new Point3(lx,ly,zk));
Axis axis = frame.getAxis(); if (axis==Axis.X) { frame.setCorners(new Point3(xk,fy,fz),new Point3(xk,ly,lz)); } else if (axis==Axis.Y) { frame.setCorners(new Point3(fx,yk,fz),new Point3(lx,yk,lz)); } else { frame.setCorners(new Point3(fx,fy,zk),new Point3(lx,ly,zk));