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

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

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

Canvas.toDisplay介绍

暂无

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

  1. menu.setLocation( canvas.toDisplay( mouseX, mouseY ) );
  2. menu.setVisible( true );

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

  1. @Override
  2. public void mouseDown(MouseEvent e) {
  3. Rectangle shellBounds= fShell.getBounds();
  4. final int shellX= shellBounds.x;
  5. final int shellY= shellBounds.y;
  6. final int shellWidth= shellBounds.width;
  7. final int shellHeight= shellBounds.height;
  8. Point mouseLoc= resizer.toDisplay(e.x, e.y);
  9. final int mouseX= mouseLoc.x;
  10. final int mouseY= mouseLoc.y;
  11. fResizeListener= new MouseMoveListener() {
  12. @Override
  13. public void mouseMove(MouseEvent e2) {
  14. Point mouseLoc2= resizer.toDisplay(e2.x, e2.y);
  15. int dx= mouseLoc2.x - mouseX;
  16. int dy= mouseLoc2.y - mouseY;
  17. if (isRTL) {
  18. setLocation(new Point(shellX + dx, shellY));
  19. setSize(shellWidth - dx, shellHeight + dy);
  20. } else {
  21. setSize(shellWidth + dx, shellHeight + dy);
  22. }
  23. }
  24. };
  25. resizer.addMouseMoveListener(fResizeListener);
  26. }

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

  1. @Override
  2. public void mouseDown(MouseEvent e) {
  3. Rectangle shellBounds= fShell.getBounds();
  4. final int shellX= shellBounds.x;
  5. final int shellY= shellBounds.y;
  6. final int shellWidth= shellBounds.width;
  7. final int shellHeight= shellBounds.height;
  8. Point mouseLoc= resizer.toDisplay(e.x, e.y);
  9. final int mouseX= mouseLoc.x;
  10. final int mouseY= mouseLoc.y;
  11. fResizeListener= e2 -> {
  12. Point mouseLoc2= resizer.toDisplay(e2.x, e2.y);
  13. int dx= mouseLoc2.x - mouseX;
  14. int dy= mouseLoc2.y - mouseY;
  15. if (isRTL) {
  16. setLocation(new Point(shellX + dx, shellY));
  17. setSize(shellWidth - dx, shellHeight + dy);
  18. } else {
  19. setSize(shellWidth + dx, shellHeight + dy);
  20. }
  21. };
  22. resizer.addMouseMoveListener(fResizeListener);
  23. }

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

  1. @Override
  2. public void mouseExit(MouseEvent e) {
  3. Item item= (Item) ((Widget) e.getSource()).getData();
  4. if (item != null)
  5. item.deselect();
  6. // if the event lies outside the entire popup, dispose
  7. org.eclipse.swt.graphics.Region region= fShell.getRegion();
  8. Canvas can= (Canvas) e.getSource();
  9. Point p= can.toDisplay(e.x, e.y);
  10. if (region == null) {
  11. Rectangle bounds= fShell.getBounds();
  12. // p= fShell.toControl(p);
  13. if (!bounds.contains(p))
  14. dispose();
  15. } else {
  16. p= fShell.toControl(p);
  17. if (!region.contains(p))
  18. dispose();
  19. }
  20. }

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

  1. public void mouseExit(MouseEvent e) {
  2. Item item= (Item) ((Widget) e.getSource()).getData();
  3. if (item != null)
  4. item.deselect();
  5. // if the event lies outside the entire popup, dispose
  6. org.eclipse.swt.graphics.Region region= fShell.getRegion();
  7. Canvas can= (Canvas) e.getSource();
  8. Point p= can.toDisplay(e.x, e.y);
  9. if (region == null) {
  10. Rectangle bounds= fShell.getBounds();
  11. // p= fShell.toControl(p);
  12. if (!bounds.contains(p))
  13. dispose();
  14. } else {
  15. p= fShell.toControl(p);
  16. if (!region.contains(p))
  17. dispose();
  18. }
  19. }

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

  1. @Override
  2. public void mouseExit(MouseEvent e) {
  3. Item item= (Item) ((Widget) e.getSource()).getData();
  4. if (item != null)
  5. item.deselect();
  6. // if the event lies outside the entire popup, dispose
  7. org.eclipse.swt.graphics.Region region= fShell.getRegion();
  8. Canvas can= (Canvas) e.getSource();
  9. Point p= can.toDisplay(e.x, e.y);
  10. if (region == null) {
  11. Rectangle bounds= fShell.getBounds();
  12. // p= fShell.toControl(p);
  13. if (!bounds.contains(p))
  14. dispose();
  15. } else {
  16. p= fShell.toControl(p);
  17. if (!region.contains(p))
  18. dispose();
  19. }
  20. }

相关文章

Canvas类方法