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

x33g5p2x  于2022-01-30 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(110)

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

Scrollable.printWidget介绍

暂无

代码示例

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

  1. @Override
  2. void printWidget (GC gc, int /*long*/ drawable, int depth, int x, int y) {
  3. Region oldClip = new Region (gc.getDevice ());
  4. Region newClip = new Region (gc.getDevice ());
  5. Point loc = DPIUtil.autoScaleDown(new Point (x, y));
  6. gc.getClipping (oldClip);
  7. Rectangle rect = getBounds ();
  8. newClip.add (oldClip);
  9. newClip.intersect (loc.x, loc.y, rect.width, rect.height);
  10. gc.setClipping (newClip);
  11. super.printWidget (gc, drawable, depth, x, y);
  12. Rectangle clientRect = getClientAreaInPixels ();
  13. Point pt = display.mapInPixels (this, parent, clientRect.x, clientRect.y);
  14. clientRect.x = x + pt.x - rect.x;
  15. clientRect.y = y + pt.y - rect.y;
  16. newClip.intersect (DPIUtil.autoScaleDown(clientRect));
  17. gc.setClipping (newClip);
  18. Control [] children = _getChildren ();
  19. for (int i=children.length-1; i>=0; --i) {
  20. Control child = children [i];
  21. if (child.getVisible ()) {
  22. Point location = child.getLocationInPixels ();
  23. child.printWidget (gc, drawable, depth, x + location.x, y + location.y);
  24. }
  25. }
  26. gc.setClipping (oldClip);
  27. oldClip.dispose ();
  28. newClip.dispose ();
  29. }

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

  1. @Override
  2. void printWidget (GC gc, long /*int*/ drawable, int depth, int x, int y) {
  3. Region oldClip = new Region (gc.getDevice ());
  4. Region newClip = new Region (gc.getDevice ());
  5. Point loc = DPIUtil.autoScaleDown(new Point (x, y));
  6. gc.getClipping (oldClip);
  7. Rectangle rect = getBounds ();
  8. newClip.add (oldClip);
  9. newClip.intersect (loc.x, loc.y, rect.width, rect.height);
  10. gc.setClipping (newClip);
  11. super.printWidget (gc, drawable, depth, x, y);
  12. Rectangle clientRect = getClientAreaInPixels ();
  13. Point pt = display.mapInPixels (this, parent, clientRect.x, clientRect.y);
  14. clientRect.x = x + pt.x - rect.x;
  15. clientRect.y = y + pt.y - rect.y;
  16. newClip.intersect (DPIUtil.autoScaleDown(clientRect));
  17. gc.setClipping (newClip);
  18. Control [] children = _getChildren ();
  19. for (int i=children.length-1; i>=0; --i) {
  20. Control child = children [i];
  21. if (child.getVisible ()) {
  22. Point location = child.getLocationInPixels ();
  23. child.printWidget (gc, drawable, depth, x + location.x, y + location.y);
  24. }
  25. }
  26. gc.setClipping (oldClip);
  27. oldClip.dispose ();
  28. newClip.dispose ();
  29. }

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

  1. @Override
  2. void printWidget (GC gc, int /*long*/ drawable, int depth, int x, int y) {
  3. Region oldClip = new Region (gc.getDevice ());
  4. Region newClip = new Region (gc.getDevice ());
  5. Point loc = DPIUtil.autoScaleDown(new Point (x, y));
  6. gc.getClipping (oldClip);
  7. Rectangle rect = getBounds ();
  8. newClip.add (oldClip);
  9. newClip.intersect (loc.x, loc.y, rect.width, rect.height);
  10. gc.setClipping (newClip);
  11. super.printWidget (gc, drawable, depth, x, y);
  12. Rectangle clientRect = getClientAreaInPixels ();
  13. Point pt = display.mapInPixels (this, parent, clientRect.x, clientRect.y);
  14. clientRect.x = x + pt.x - rect.x;
  15. clientRect.y = y + pt.y - rect.y;
  16. newClip.intersect (DPIUtil.autoScaleDown(clientRect));
  17. gc.setClipping (newClip);
  18. Control [] children = _getChildren ();
  19. for (int i=children.length-1; i>=0; --i) {
  20. Control child = children [i];
  21. if (child.getVisible ()) {
  22. Point location = child.getLocationInPixels ();
  23. child.printWidget (gc, drawable, depth, x + location.x, y + location.y);
  24. }
  25. }
  26. gc.setClipping (oldClip);
  27. oldClip.dispose ();
  28. newClip.dispose ();
  29. }

相关文章

Scrollable类方法