/** * Returns <code>true</code> if the specified point is contained by the receiver and false * otherwise. * * <p>If outline is <code>true</code>, the point (x, y) checked for containment in the receiver's * outline. If outline is <code>false</code>, the point is checked to see if it is contained * within the bounds of the (closed) area covered by the receiver. * * @param x the x coordinate of the point to test for containment * @param y the y coordinate of the point to test for containment * @param gc the GC to use when testing for containment * @param outline controls whether to check the outline or contained area of the path * @return <code>true</code> if the path contains the point and <code>false</code> otherwise * @exception IllegalArgumentException * <ul> * <li>ERROR_NULL_ARGUMENT - if the gc is null * <li>ERROR_INVALID_ARGUMENT - if the gc has been disposed * </ul> * * @exception SWTException * <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed * </ul> */ public boolean contains(float x, float y, GC gc, boolean outline) { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (gc == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (gc.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); // gc.checkGC(GC.LINE_CAP | GC.LINE_JOIN | GC.LINE_STYLE | GC.LINE_WIDTH); // TODO outline NSPoint point = new NSPoint(); point.x = x; point.y = y; return handle.containsPoint(point); }