com.vaadin.ui.Window.setPositionY()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(101)

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

Window.setPositionY介绍

[英]Sets the distance of Window top border in pixels from top border of the containing (main window). Has effect only if in WindowMode#NORMALmode.
[中]设置窗口上边框与包含窗口(主窗口)的上边框之间的距离(以像素为单位)。仅在WindowMode#Normal Mode下有效。

代码示例

代码示例来源:origin: com.vaadin/vaadin-server

/**
 * Sets the position of the window on the screen using
 * {@link #setPositionX(int)} and {@link #setPositionY(int)}.
 *
 * @since 7.5
 * @param x
 *            The new x coordinate for the window
 * @param y
 *            The new y coordinate for the window
 */
public void setPosition(int x, int y) {
  setPositionX(x);
  setPositionY(y);
}

代码示例来源:origin: com.vaadin/vaadin-server

@Override
  public void windowMoved(int x, int y) {
    if (x != getState(false).positionX) {
      setPositionX(x);
    }
    if (y != getState(false).positionY) {
      setPositionY(y);
    }
  }
};

代码示例来源:origin: com.vaadin/vaadin-server

setPositionY(y < 0 ? -1 : y);

代码示例来源:origin: com.vaadin/vaadin-server

@Override
public void readDesign(Element design, DesignContext context) {
  super.readDesign(design, context);
  if (design.hasAttr("center")) {
    center();
  }
  if (design.hasAttr("position")) {
    String[] position = design.attr("position").split(",");
    setPositionX(Integer.parseInt(position[0]));
    setPositionY(Integer.parseInt(position[1]));
  }
  // Parse shortcuts if defined, otherwise rely on default behavior
  if (design.hasAttr("close-shortcut")) {
    // Parse shortcuts
    String[] shortcutStrings = DesignAttributeHandler
        .readAttribute("close-shortcut", design.attributes(),
            String.class)
        .split("\\s+");
    removeAllCloseShortcuts();
    for (String part : shortcutStrings) {
      if (!part.isEmpty()) {
        ShortcutAction shortcut = DesignAttributeHandler
            .getFormatter()
            .parse(part.trim(), ShortcutAction.class);
        addCloseShortcut(shortcut.getKeyCode(),
            shortcut.getModifiers());
      }
    }
  }
}

代码示例来源:origin: KrailOrg/krail

/**
 * Forces a y position for the message dialog.
 *
 * @param y The y position
 * @return The {@link MessageBox} instance itself
 */
public MessageBox withDialogPositionY(int y) {
  window.setPositionY(y);
  return this;
}

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

private void toggleWindow(final ClickEvent event) {
  if (notificationsWindow.isAttached()) {
    getUI().removeWindow(notificationsWindow);
    return;
  }
  createUnreadMessagesLayout();
  notificationsWindow.setPositionY(event.getClientY() - event.getRelativeY() + 40);
  getUI().addWindow(notificationsWindow);
  currentView.refreshView(unreadNotifications.keySet());
  clear();
  notificationsWindow.focus();
}

代码示例来源:origin: eclipse/hawkbit

private void toggleWindow(final ClickEvent event) {
  if (notificationsWindow.isAttached()) {
    getUI().removeWindow(notificationsWindow);
    return;
  }
  createUnreadMessagesLayout();
  notificationsWindow.setPositionY(event.getClientY() - event.getRelativeY() + 40);
  getUI().addWindow(notificationsWindow);
  currentView.refreshView(unreadNotifications.keySet());
  clear();
  notificationsWindow.focus();
}

代码示例来源:origin: com.github.markash/components

notificationsWindow.setPositionY(event.getClientY() - event.getRelativeY() + 40);
notificationsWindow.setPositionX(event.getClientX() - event.getRelativeX() - 300);
getUI().addWindow(notificationsWindow);

相关文章

微信公众号

最新文章

更多