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

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

本文整理了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

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

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

@Override
public void mouseDown(MouseEvent e) {
  Rectangle shellBounds= fShell.getBounds();
  final int shellX= shellBounds.x;
  final int shellY= shellBounds.y;
  final int shellWidth= shellBounds.width;
  final int shellHeight= shellBounds.height;
  Point mouseLoc= resizer.toDisplay(e.x, e.y);
  final int mouseX= mouseLoc.x;
  final int mouseY= mouseLoc.y;
  fResizeListener= new MouseMoveListener() {
    @Override
    public void mouseMove(MouseEvent e2) {
      Point mouseLoc2= resizer.toDisplay(e2.x, e2.y);
      int dx= mouseLoc2.x - mouseX;
      int dy= mouseLoc2.y - mouseY;
      if (isRTL) {
        setLocation(new Point(shellX + dx, shellY));
        setSize(shellWidth - dx, shellHeight + dy);
      } else {
        setSize(shellWidth + dx, shellHeight + dy);
      }
    }
  };
  resizer.addMouseMoveListener(fResizeListener);
}

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

@Override
public void mouseDown(MouseEvent e) {
  Rectangle shellBounds= fShell.getBounds();
  final int shellX= shellBounds.x;
  final int shellY= shellBounds.y;
  final int shellWidth= shellBounds.width;
  final int shellHeight= shellBounds.height;
  Point mouseLoc= resizer.toDisplay(e.x, e.y);
  final int mouseX= mouseLoc.x;
  final int mouseY= mouseLoc.y;
  fResizeListener= e2 -> {
    Point mouseLoc2= resizer.toDisplay(e2.x, e2.y);
    int dx= mouseLoc2.x - mouseX;
    int dy= mouseLoc2.y - mouseY;
    if (isRTL) {
      setLocation(new Point(shellX + dx, shellY));
      setSize(shellWidth - dx, shellHeight + dy);
    } else {
      setSize(shellWidth + dx, shellHeight + dy);
    }
  };
  resizer.addMouseMoveListener(fResizeListener);
}

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

@Override
    public void mouseExit(MouseEvent e) {

      Item item= (Item) ((Widget) e.getSource()).getData();
      if (item != null)
        item.deselect();

      // if the event lies outside the entire popup, dispose
      org.eclipse.swt.graphics.Region region= fShell.getRegion();
      Canvas can= (Canvas) e.getSource();
      Point p= can.toDisplay(e.x, e.y);
      if (region == null) {
        Rectangle bounds= fShell.getBounds();
//                p= fShell.toControl(p);
        if (!bounds.contains(p))
          dispose();
      } else {
        p= fShell.toControl(p);
        if (!region.contains(p))
          dispose();
      }

    }

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

public void mouseExit(MouseEvent e) {

      Item item= (Item) ((Widget) e.getSource()).getData();
      if (item != null)
        item.deselect();

      // if the event lies outside the entire popup, dispose
      org.eclipse.swt.graphics.Region region= fShell.getRegion();
      Canvas can= (Canvas) e.getSource();
      Point p= can.toDisplay(e.x, e.y);
      if (region == null) {
        Rectangle bounds= fShell.getBounds();
//                p= fShell.toControl(p);
        if (!bounds.contains(p))
          dispose();
      } else {
        p= fShell.toControl(p);
        if (!region.contains(p))
          dispose();
      }

    }

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

@Override
    public void mouseExit(MouseEvent e) {

      Item item= (Item) ((Widget) e.getSource()).getData();
      if (item != null)
        item.deselect();

      // if the event lies outside the entire popup, dispose
      org.eclipse.swt.graphics.Region region= fShell.getRegion();
      Canvas can= (Canvas) e.getSource();
      Point p= can.toDisplay(e.x, e.y);
      if (region == null) {
        Rectangle bounds= fShell.getBounds();
//                p= fShell.toControl(p);
        if (!bounds.contains(p))
          dispose();
      } else {
        p= fShell.toControl(p);
        if (!region.contains(p))
          dispose();
      }

    }

相关文章

Canvas类方法