org.eclipse.swt.widgets.Canvas.scrollInPixels()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(187)

本文整理了Java中org.eclipse.swt.widgets.Canvas.scrollInPixels()方法的一些代码示例,展示了Canvas.scrollInPixels()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Canvas.scrollInPixels()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Canvas
类名称:Canvas
方法名:scrollInPixels

Canvas.scrollInPixels介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

  1. /**
  2. * Scrolls a rectangular area of the receiver by first copying
  3. * the source area to the destination and then causing the area
  4. * of the source which is not covered by the destination to
  5. * be repainted. Children that intersect the rectangle are
  6. * optionally moved during the operation. In addition, all outstanding
  7. * paint events are flushed before the source area is copied to
  8. * ensure that the contents of the canvas are drawn correctly.
  9. *
  10. * @param destX the x coordinate of the destination
  11. * @param destY the y coordinate of the destination
  12. * @param x the x coordinate of the source
  13. * @param y the y coordinate of the source
  14. * @param width the width of the area
  15. * @param height the height of the area
  16. * @param all <code>true</code>if children should be scrolled, and <code>false</code> otherwise
  17. *
  18. * @exception SWTException <ul>
  19. * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  20. * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  21. * </ul>
  22. */
  23. public void scroll (int destX, int destY, int x, int y, int width, int height, boolean all) {
  24. checkWidget();
  25. if (width <= 0 || height <= 0) return;
  26. Point destination = DPIUtil.autoScaleUp (new Point (destX, destY));
  27. Rectangle srcRect = DPIUtil.autoScaleUp (new Rectangle (x, y, width, height));
  28. scrollInPixels(destination.x, destination.y, srcRect.x, srcRect.y, srcRect.width, srcRect.height, all);
  29. }

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

  1. /**
  2. * Scrolls a rectangular area of the receiver by first copying
  3. * the source area to the destination and then causing the area
  4. * of the source which is not covered by the destination to
  5. * be repainted. Children that intersect the rectangle are
  6. * optionally moved during the operation. In addition, all outstanding
  7. * paint events are flushed before the source area is copied to
  8. * ensure that the contents of the canvas are drawn correctly.
  9. *
  10. * @param destX the x coordinate of the destination
  11. * @param destY the y coordinate of the destination
  12. * @param x the x coordinate of the source
  13. * @param y the y coordinate of the source
  14. * @param width the width of the area
  15. * @param height the height of the area
  16. * @param all <code>true</code>if children should be scrolled, and <code>false</code> otherwise
  17. *
  18. * @exception SWTException <ul>
  19. * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  20. * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  21. * </ul>
  22. */
  23. public void scroll (int destX, int destY, int x, int y, int width, int height, boolean all) {
  24. checkWidget();
  25. if (width <= 0 || height <= 0) return;
  26. Point destination = DPIUtil.autoScaleUp (new Point (destX, destY));
  27. Rectangle srcRect = DPIUtil.autoScaleUp (new Rectangle (x, y, width, height));
  28. scrollInPixels(destination.x, destination.y, srcRect.x, srcRect.y, srcRect.width, srcRect.height, all);
  29. }

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

  1. /**
  2. * Scrolls a rectangular area of the receiver by first copying
  3. * the source area to the destination and then causing the area
  4. * of the source which is not covered by the destination to
  5. * be repainted. Children that intersect the rectangle are
  6. * optionally moved during the operation. In addition, all outstanding
  7. * paint events are flushed before the source area is copied to
  8. * ensure that the contents of the canvas are drawn correctly.
  9. *
  10. * @param destX the x coordinate of the destination
  11. * @param destY the y coordinate of the destination
  12. * @param x the x coordinate of the source
  13. * @param y the y coordinate of the source
  14. * @param width the width of the area
  15. * @param height the height of the area
  16. * @param all <code>true</code>if children should be scrolled, and <code>false</code> otherwise
  17. *
  18. * @exception SWTException <ul>
  19. * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  20. * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  21. * </ul>
  22. */
  23. public void scroll (int destX, int destY, int x, int y, int width, int height, boolean all) {
  24. checkWidget();
  25. if (width <= 0 || height <= 0) return;
  26. Point destination = DPIUtil.autoScaleUp (new Point (destX, destY));
  27. Rectangle srcRect = DPIUtil.autoScaleUp (new Rectangle (x, y, width, height));
  28. scrollInPixels(destination.x, destination.y, srcRect.x, srcRect.y, srcRect.width, srcRect.height, all);
  29. }

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

  1. width = DPIUtil.autoScaleUp(width);
  2. height = DPIUtil.autoScaleUp(height);
  3. scrollInPixels(destX, destY, x, y, width, height, all);

相关文章

Canvas类方法