/** * Scrolls a rectangular area of the receiver by first copying * the source area to the destination and then causing the area * of the source which is not covered by the destination to * be repainted. Children that intersect the rectangle are * optionally moved during the operation. In addition, all outstanding * paint events are flushed before the source area is copied to * ensure that the contents of the canvas are drawn correctly. * * @param destX the x coordinate of the destination * @param destY the y coordinate of the destination * @param x the x coordinate of the source * @param y the y coordinate of the source * @param width the width of the area * @param height the height of the area * @param all <code>true</code>if children should be scrolled, and <code>false</code> otherwise * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void scroll (int destX, int destY, int x, int y, int width, int height, boolean all) { checkWidget(); if (width <= 0 || height <= 0) return; Point destination = DPIUtil.autoScaleUp (new Point (destX, destY)); Rectangle srcRect = DPIUtil.autoScaleUp (new Rectangle (x, y, width, height)); scrollInPixels(destination.x, destination.y, srcRect.x, srcRect.y, srcRect.width, srcRect.height, all); }
/** * Scrolls a rectangular area of the receiver by first copying * the source area to the destination and then causing the area * of the source which is not covered by the destination to * be repainted. Children that intersect the rectangle are * optionally moved during the operation. In addition, all outstanding * paint events are flushed before the source area is copied to * ensure that the contents of the canvas are drawn correctly. * * @param destX the x coordinate of the destination * @param destY the y coordinate of the destination * @param x the x coordinate of the source * @param y the y coordinate of the source * @param width the width of the area * @param height the height of the area * @param all <code>true</code>if children should be scrolled, and <code>false</code> otherwise * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void scroll (int destX, int destY, int x, int y, int width, int height, boolean all) { checkWidget(); if (width <= 0 || height <= 0) return; Point destination = DPIUtil.autoScaleUp (new Point (destX, destY)); Rectangle srcRect = DPIUtil.autoScaleUp (new Rectangle (x, y, width, height)); scrollInPixels(destination.x, destination.y, srcRect.x, srcRect.y, srcRect.width, srcRect.height, all); }
/** * Scrolls a rectangular area of the receiver by first copying * the source area to the destination and then causing the area * of the source which is not covered by the destination to * be repainted. Children that intersect the rectangle are * optionally moved during the operation. In addition, all outstanding * paint events are flushed before the source area is copied to * ensure that the contents of the canvas are drawn correctly. * * @param destX the x coordinate of the destination * @param destY the y coordinate of the destination * @param x the x coordinate of the source * @param y the y coordinate of the source * @param width the width of the area * @param height the height of the area * @param all <code>true</code>if children should be scrolled, and <code>false</code> otherwise * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void scroll (int destX, int destY, int x, int y, int width, int height, boolean all) { checkWidget(); if (width <= 0 || height <= 0) return; Point destination = DPIUtil.autoScaleUp (new Point (destX, destY)); Rectangle srcRect = DPIUtil.autoScaleUp (new Rectangle (x, y, width, height)); scrollInPixels(destination.x, destination.y, srcRect.x, srcRect.y, srcRect.width, srcRect.height, all); }
width = DPIUtil.autoScaleUp(width); height = DPIUtil.autoScaleUp(height); scrollInPixels(destX, destY, x, y, width, height, all);