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

x33g5p2x  于2022-01-29 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(114)

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

Shell.toDisplay介绍

暂无

代码示例

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

@Override
  public Point getLocation(Point tipSize, Event event) {
    return messageLabel.getShell().toDisplay(messageLabel.getLocation());
  }
};

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

@Override
  public Point getLocation(Point tipSize, Event event) {
    return messageLabel.getShell().toDisplay(messageLabel.getLocation());
  }
};

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

protected Point getStackedLocation(Shell shell, Shell parent) {
  Point p= parent.getLocation();
  Point size= parent.getSize();
  p.x += size.x / 4;
  p.y += size.y;
  p= parent.toDisplay(p);
  Rectangle shellBounds= shell.getBounds();
  Rectangle displayBounds= shell.getDisplay().getClientArea();
  shiftHorizontalLocation(p, shellBounds, displayBounds);
  shiftVerticalLocation(p, shellBounds, displayBounds);
  return p;
}

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

protected Point getStackedLocation(Shell shell, Shell parent) {
  Point p= parent.getLocation();
  Point size= parent.getSize();
  p.x += size.x / 4;
  p.y += size.y;
  p= parent.toDisplay(p);
  Rectangle shellBounds= shell.getBounds();
  Rectangle displayBounds= shell.getDisplay().getClientArea();
  shiftHorizontalLocation(p, shellBounds, displayBounds);
  shiftVerticalLocation(p, shellBounds, displayBounds);
  return p;
}

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

protected Point getStackedLocation(Shell shell, Shell parent) {
  Point p= parent.getLocation();
  Point size= parent.getSize();
  p.x += size.x / 4;
  p.y += size.y;
  p= parent.toDisplay(p);
  Point shellSize= shell.getSize();
  Monitor monitor= getClosestMonitor(parent.getDisplay(), new Rectangle(p.x, p.y, 0, 0));
  Rectangle displayBounds= monitor.getClientArea();
  constrainLocation(p, shellSize, displayBounds);
  return p;
}

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

protected Point getStackedLocation(Shell shell, Shell parent) {
  Point p= parent.getLocation();
  Point size= parent.getSize();
  p.x += size.x / 4;
  p.y += size.y;
  p= parent.toDisplay(p);
  Point shellSize= shell.getSize();
  Monitor monitor= getClosestMonitor(parent.getDisplay(), new Rectangle(p.x, p.y, 0, 0));
  Rectangle displayBounds= monitor.getClientArea();
  constrainLocation(p, shellSize, displayBounds);
  return p;
}

代码示例来源:origin: ystrot/glance

private Point getTargetLocation() {
  Shell shell = target.getShell();
  Display display = target.getDisplay();
  Point location = target.getLocation();
  location = display.map(target.getParent(), shell, location);
  return shell.toDisplay(location);
}

代码示例来源:origin: stefanhaustein/flowgrid

@Override
public void widgetSelected(SelectionEvent e) {
  Menu menu = new Menu(shell);
  currentEditor.fillMenu(menu);
  menu.setLocation(shell.toDisplay(shell.getSize().x, shell.getClientArea().y));
  menu.setVisible(true);
}

代码示例来源:origin: BiglySoftware/BiglyBT

private void performDocking() {
  if (isAlive()) {
    switch (anchorControlPosition.getPosition()) {
      case DockPosition.TOP_LEFT:
        dockedShell.setLocation(mainShell.toDisplay(anchorControl.getLocation()));
        break;
      case DockPosition.TOP_RIGHT:
        break;
      case DockPosition.BOTTOM_LEFT: {
        Point p = mainShell.toDisplay(anchorControl.getLocation());
        p.x += anchorControlPosition.getOffset().xOffset;
        p.y += anchorControlPosition.getOffset().yOffset;
        p.y += anchorControl.getSize().y;
        dockedShell.setLocation(p);
      }
        break;
      case DockPosition.BOTTOM_RIGHT: {
        Point p = mainShell.toDisplay(anchorControl.getLocation());
        p.x += anchorControlPosition.getOffset().xOffset;
        p.y += anchorControlPosition.getOffset().yOffset;
        p.x += anchorControl.getSize().x;
        p.y += anchorControl.getSize().y;
        dockedShell.setLocation(p);
      }
        break;
      default:
        break;
    }
  }
}

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

/**
 * Show the dialog's menu. This message has no effect if the receiver was
 * not configured to show a menu. Clients may call this method in order to
 * trigger the menu via keystrokes or other gestures. Subclasses typically
 * do not override method.
 */
protected void showDialogMenu() {
  if (!showDialogMenu) {
    return;
  }
  if (menuManager == null) {
    menuManager = new MenuManager();
    fillDialogMenu(menuManager);
  }
  // Setting this flag works around a problem that remains on X only,
  // whereby activating the menu deactivates our shell.
  listenToDeactivate = !Util.isGtk();
  Menu menu = menuManager.createContextMenu(getShell());
  Rectangle bounds = toolBar.getBounds();
  Point topLeft = new Point(bounds.x, bounds.y + bounds.height);
  topLeft = getShell().toDisplay(topLeft);
  menu.setLocation(topLeft.x, topLeft.y);
  menu.setVisible(true);
}

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

/**
 * Show the dialog's menu. This message has no effect if the receiver was
 * not configured to show a menu. Clients may call this method in order to
 * trigger the menu via keystrokes or other gestures. Subclasses typically
 * do not override method.
 */
protected void showDialogMenu() {
  if (!showDialogMenu) {
    return;
  }
  if (menuManager == null) {
    menuManager = new MenuManager();
    fillDialogMenu(menuManager);
  }
  // Setting this flag works around a problem that remains on X only,
  // whereby activating the menu deactivates our shell.
  listenToDeactivate = !Util.isGtk();
  Menu menu = menuManager.createContextMenu(getShell());
  Rectangle bounds = toolBar.getBounds();
  Point topLeft = new Point(bounds.x, bounds.y + bounds.height);
  topLeft = getShell().toDisplay(topLeft);
  menu.setLocation(topLeft.x, topLeft.y);
  menu.setVisible(true);
}

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

/**
 * Show the dialog's menu. This message has no effect if the receiver was
 * not configured to show a menu. Clients may call this method in order to
 * trigger the menu via keystrokes or other gestures. Subclasses typically
 * do not override method.
 */
protected void showDialogMenu() {
  if (!showDialogMenu) {
    return;
  }
  if (menuManager == null) {
    menuManager = new MenuManager();
    fillDialogMenu(menuManager);
  }
  // Setting this flag works around a problem that remains on X only,
  // whereby activating the menu deactivates our shell.
  listenToDeactivate = !Util.isGtk();
  Menu menu = menuManager.createContextMenu(getShell());
  Rectangle bounds = toolBar.getBounds();
  Point topLeft = new Point(bounds.x, bounds.y + bounds.height);
  topLeft = getShell().toDisplay(topLeft);
  menu.setLocation(topLeft.x, topLeft.y);
  menu.setVisible(true);
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

pt = control.getParent().toDisplay(location.x, location.y);
else 
  pt = ((Shell)control).toDisplay(location.x, location.y);

代码示例来源:origin: BiglySoftware/BiglyBT

Point location = shell.toDisplay(0, 0);
gcFullImage.drawImage(subImage, location.x - shellBounds.x, location.y
    - shellBounds.y);

代码示例来源:origin: BiglySoftware/BiglyBT

Point ptBottomRight = shell.toDisplay(shellSize);
Rectangle monitorArea = shell.getMonitor().getClientArea();
if (ptBottomRight.x > monitorArea.x + monitorArea.width) {

相关文章

微信公众号

最新文章

更多

Shell类方法