Ejemplo n.º 1
0
 /**
  * Adds to the receiver a quadratic curve based on the parameters.
  *
  * @param cx the x coordinate of the control point of the spline
  * @param cy the y coordinate of the control point of the spline
  * @param x the x coordinate of the end point of the spline
  * @param y the y coordinate of the end point of the spline
  * @exception SWTException
  *     <ul>
  *       <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed
  *     </ul>
  */
 public void quadTo(float cx, float cy, float x, float y) {
   if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
   NSPoint pt = new NSPoint();
   pt.x = x;
   pt.y = y;
   NSPoint ct = new NSPoint();
   ct.x = cx;
   ct.y = cy;
   handle.curveToPoint(pt, ct, ct);
 }
Ejemplo n.º 2
0
 /**
  * Adds to the receiver a cubic bezier curve based on the parameters.
  *
  * @param cx1 the x coordinate of the first control point of the spline
  * @param cy1 the y coordinate of the first control of the spline
  * @param cx2 the x coordinate of the second control of the spline
  * @param cy2 the y coordinate of the second control of the spline
  * @param x the x coordinate of the end point of the spline
  * @param y the y coordinate of the end point of the spline
  * @exception SWTException
  *     <ul>
  *       <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed
  *     </ul>
  */
 public void cubicTo(float cx1, float cy1, float cx2, float cy2, float x, float y) {
   if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
   NSPoint pt = new NSPoint();
   pt.x = x;
   pt.y = y;
   NSPoint ct1 = new NSPoint();
   ct1.x = cx1;
   ct1.y = cy1;
   NSPoint ct2 = new NSPoint();
   ct2.x = cx2;
   ct2.y = cy2;
   handle.curveToPoint(pt, ct1, ct2);
 }