/** * Intersects the given rectangle to the collection of polygons * the receiver maintains to describe its area. * * @param rect the rectangle to intersect with the receiver * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the argument is null</li> * <li>ERROR_INVALID_ARGUMENT - if the rectangle's width or height is negative</li> * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> * * @since 3.0 */ public void intersect(Rectangle rect) { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (rect == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); intersect (rect.x, rect.y, rect.width, rect.height); }
/** * Intersects the given rectangle to the collection of polygons * the receiver maintains to describe its area. * * @param x the x coordinate of the rectangle * @param y the y coordinate of the rectangle * @param width the width coordinate of the rectangle * @param height the height coordinate of the rectangle * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the rectangle's width or height is negative</li> * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> * * @since 3.1 */ public void intersect(int x, int y, int width, int height) { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (width < 0 || height < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT); intersect(new Rectangle(x, y, width, height)); }
/** * Intersects the given rectangle to the collection of polygons * the receiver maintains to describe its area. * * @param x the x coordinate of the rectangle * @param y the y coordinate of the rectangle * @param width the width coordinate of the rectangle * @param height the height coordinate of the rectangle * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the rectangle's width or height is negative</li> * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> * * @since 3.1 */ public void intersect(int x, int y, int width, int height) { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (width < 0 || height < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT); intersect(new Rectangle(x, y, width, height)); }
/** * Intersects the given rectangle to the collection of polygons * the receiver maintains to describe its area. * * @param x the x coordinate of the rectangle * @param y the y coordinate of the rectangle * @param width the width coordinate of the rectangle * @param height the height coordinate of the rectangle * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the rectangle's width or height is negative</li> * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> * * @since 3.1 */ public void intersect(int x, int y, int width, int height) { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (width < 0 || height < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT); intersect(new Rectangle(x, y, width, height)); }
void fillRegion(GC gc, Region region) { // NOTE: region passed in to this function will be modified Region clipping = new Region(); gc.getClipping(clipping); region.intersect(clipping); gc.setClipping(region); gc.fillRectangle(region.getBounds()); gc.setClipping(clipping); clipping.dispose(); }
void fillRegion(GC gc, Region region) { // NOTE: region passed in to this function will be modified Region clipping = new Region(); gc.getClipping(clipping); region.intersect(clipping); gc.setClipping(region); gc.fillRectangle(region.getBounds()); gc.setClipping(clipping); clipping.dispose(); }
void fillRegion(GC gc, Region region) { // NOTE: region passed in to this function will be modified Region clipping = new Region(); gc.getClipping(clipping); region.intersect(clipping); gc.setClipping(region); gc.fillRectangle(region.getBounds()); gc.setClipping(clipping); clipping.dispose(); }
void fillRegion(GC gc, Region region) { // NOTE: region passed in to this function will be modified Region clipping = new Region(); gc.getClipping(clipping); region.intersect(clipping); gc.setClipping(region); gc.fillRectangle(region.getBounds()); gc.setClipping(clipping); clipping.dispose(); }
void fillRegion(GC gc, Region region) { // NOTE: region passed in to this function will be modified Region clipping = new Region(); gc.getClipping(clipping); region.intersect(clipping); gc.setClipping(region); gc.fillRectangle(region.getBounds()); gc.setClipping(clipping); clipping.dispose(); }
Region region = new Region(); region.add(shape); region.intersect(clipping); gc.setClipping(region);
Region clipping = new Region(); gc.getClipping(clipping); r.intersect(clipping); gc.setClipping(r); Rectangle mappedBounds = display
@Override void printWidget (GC gc, int /*long*/ drawable, int depth, int x, int y) { Region oldClip = new Region (gc.getDevice ()); Region newClip = new Region (gc.getDevice ()); Point loc = DPIUtil.autoScaleDown(new Point (x, y)); gc.getClipping (oldClip); Rectangle rect = getBounds (); newClip.add (oldClip); newClip.intersect (loc.x, loc.y, rect.width, rect.height); gc.setClipping (newClip); super.printWidget (gc, drawable, depth, x, y); Rectangle clientRect = getClientAreaInPixels (); Point pt = display.mapInPixels (this, parent, clientRect.x, clientRect.y); clientRect.x = x + pt.x - rect.x; clientRect.y = y + pt.y - rect.y; newClip.intersect (DPIUtil.autoScaleDown(clientRect)); gc.setClipping (newClip); Control [] children = _getChildren (); for (int i=children.length-1; i>=0; --i) { Control child = children [i]; if (child.getVisible ()) { Point location = child.getLocationInPixels (); child.printWidget (gc, drawable, depth, x + location.x, y + location.y); } } gc.setClipping (oldClip); oldClip.dispose (); newClip.dispose (); }
@Override void printWidget (GC gc, long /*int*/ drawable, int depth, int x, int y) { Region oldClip = new Region (gc.getDevice ()); Region newClip = new Region (gc.getDevice ()); Point loc = DPIUtil.autoScaleDown(new Point (x, y)); gc.getClipping (oldClip); Rectangle rect = getBounds (); newClip.add (oldClip); newClip.intersect (loc.x, loc.y, rect.width, rect.height); gc.setClipping (newClip); super.printWidget (gc, drawable, depth, x, y); Rectangle clientRect = getClientAreaInPixels (); Point pt = display.mapInPixels (this, parent, clientRect.x, clientRect.y); clientRect.x = x + pt.x - rect.x; clientRect.y = y + pt.y - rect.y; newClip.intersect (DPIUtil.autoScaleDown(clientRect)); gc.setClipping (newClip); Control [] children = _getChildren (); for (int i=children.length-1; i>=0; --i) { Control child = children [i]; if (child.getVisible ()) { Point location = child.getLocationInPixels (); child.printWidget (gc, drawable, depth, x + location.x, y + location.y); } } gc.setClipping (oldClip); oldClip.dispose (); newClip.dispose (); }
@Override void printWidget (GC gc, int /*long*/ drawable, int depth, int x, int y) { Region oldClip = new Region (gc.getDevice ()); Region newClip = new Region (gc.getDevice ()); Point loc = DPIUtil.autoScaleDown(new Point (x, y)); gc.getClipping (oldClip); Rectangle rect = getBounds (); newClip.add (oldClip); newClip.intersect (loc.x, loc.y, rect.width, rect.height); gc.setClipping (newClip); super.printWidget (gc, drawable, depth, x, y); Rectangle clientRect = getClientAreaInPixels (); Point pt = display.mapInPixels (this, parent, clientRect.x, clientRect.y); clientRect.x = x + pt.x - rect.x; clientRect.y = y + pt.y - rect.y; newClip.intersect (DPIUtil.autoScaleDown(clientRect)); gc.setClipping (newClip); Control [] children = _getChildren (); for (int i=children.length-1; i>=0; --i) { Control child = children [i]; if (child.getVisible ()) { Point location = child.getLocationInPixels (); child.printWidget (gc, drawable, depth, x + location.x, y + location.y); } } gc.setClipping (oldClip); oldClip.dispose (); newClip.dispose (); }
Region clipping = new Region(); gc.getClipping(clipping); r.intersect(clipping); gc.setClipping(r); Image b = toolParent.getBackgroundImage();
case 4: region1.intersect(region2); break;
region = new Region(); region.add(shape); region.intersect(clipping); gc.setClipping(region);
region = new Region(); region.add(shape); region.intersect(clipping); gc.setClipping(region);
region = new Region(); region.add(shape); region.intersect(clipping); gc.setClipping(region);