com.smartgwt.client.widgets.Window.setAutoCenter()方法的使用及代码示例

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

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

Window.setAutoCenter介绍

[英]If true, this Window widget will automatically be centered on the page when shown. If false, it will show up in the last position it was placed (either programmatically, or by user interaction).
[中]如果为true,则当显示时,此窗口小部件将自动在页面上居中。如果为false,它将显示在最后一个位置(通过编程或用户交互)。

代码示例

代码示例来源:origin: org.geomajas.widget/geomajas-widget-featureinfo-gwt

public void onMinimizeClick(MinimizeClickEvent event) {
  originalWidth = window.getWidth();
  originalLeft = window.getLeft();
  originalTop = window.getTop();
  originalDragRepo = window.getCanDragReposition();
  window.setCanDragReposition(false); // doens't work !?
  window.setAutoCenter(false);
  docked = true;
  GWT.runAsync(new RunAsyncCallback() {
    public void onSuccess() {
      window.animateRect(currentPosition, Document.get().getBody().getClientHeight() - minimizedHeight,
          minimizedWidth, null, new AnimationCallback() {
            public void execute(boolean earlyFinish) {
              currentPosition += window.getWidth(); // not
                                // necessarily
                                // equal
                                // to
                                // minimizedWidth.
            }
          });
    }
    public void onFailure(Throwable reason) {
    }
  });
}

代码示例来源:origin: org.geomajas.widget/geomajas-widget-featureinfo-gwt

private Window createWindow(String subtitle) {
  Window w = new Window();
  w.setWidth(windowWidth);
  w.setHeight(windowHeight);
  w.setTitle(I18nProvider.getAttribute().getAttributeWindowTitle(subtitle));
  w.setCanDragReposition(true);
  w.setCanDragResize(true);
  w.setAutoCenter(true);
  w.setKeepInParentRect(true);
  return w;
}

代码示例来源:origin: org.geomajas/geomajas-project-deskmanager-gwt

public void onClick(ClickEvent event) {
    Window window = new Window();
    window.setTitle(MESSAGES.geodeskLabel() + ": " + rollOverRecord.getAttribute(FLD_NAME));
    window.setAutoCenter(true);
    window.setWidth("90%");
    window.setHeight("90%");
    window.setSrc(GeodeskUrlUtil.createPreviewUrl(rollOverRecord.getAttribute(FLD_GEODESKID)));
    window.setContentsType("page");
    window.show();
  }
});

代码示例来源:origin: com.github.livesense/org.liveSense.jcr.explorer

private Window createRemoteWindow(String title, String url) {
  Window remoteWindow = new Window();
  HTMLPane htmlPane = new HTMLPane();
  htmlPane.setContentsURL(url);
  htmlPane.setContentsType(ContentsType.PAGE);
  remoteWindow.addItem(htmlPane);
  remoteWindow.setTitle(title);
  remoteWindow.setShowMaximizeButton(true);
  remoteWindow.setCanDragReposition(true);
  remoteWindow.setCanDragResize(true);
  remoteWindow.setHeight("40%");
  remoteWindow.setWidth("40%");
  remoteWindow.setAutoCenter(true);
  remoteWindow.setShowResizeBar(true);
  remoteWindow.setDefaultResizeBars(LayoutResizeBarPolicy.MARKED);
  remoteWindow.show();
  return remoteWindow;
}

代码示例来源:origin: com.github.livesense/org.liveSense.jcr.explorer

private Window createBinaryImgWindow(String title, String path, String mimeType) {
  Window binaryWindow = new Window();
  Img img = new Img(BINARY_SERVLET_PATH + path);
  img.setImageType(ImageStyle.STRETCH);
  img.setHeight100();
  img.setWidth100();
  binaryWindow.addItem(img);
  binaryWindow.setTitle(title);
  binaryWindow.setShowMaximizeButton(true);
  binaryWindow.setCanDragReposition(true);
  binaryWindow.setCanDragResize(true);
  binaryWindow.setHeight("40%");
  binaryWindow.setWidth("40%");
  binaryWindow.setAutoCenter(true);
  binaryWindow.setShowResizeBar(true);
  //binaryWindow.setDefaultResizeBars(LayoutResizeBarPolicy.MARKED);
  binaryWindow.show();
  return binaryWindow;
}

代码示例来源:origin: org.geomajas.widget/geomajas-widget-searchandfilter-gwt

w.setShowCloseButton(false);
w.setKeepInParentRect(true);
w.setAutoCenter(true);
return w;

代码示例来源:origin: com.github.livesense/org.liveSense.jcr.explorer

changeNodeTypeWindow.setCanDragReposition(true);
changeNodeTypeWindow.setCanDragResize(false);
changeNodeTypeWindow.setAutoCenter(true);
changeNodeTypeWindow.setWidth(500);
changeNodeTypeWindow.setHeight(400);

代码示例来源:origin: org.geomajas.widget/geomajas-widget-searchandfilter-gwt

addWindow.setWidth(310);
addWindow.setHeight(145);
addWindow.setAutoCenter(true);
addWindow.setShowMinimizeButton(false);
addWindow.setIsModal(true);

代码示例来源:origin: com.github.livesense/org.liveSense.jcr.explorer

editPropertyWindow.setHeight(600);
editPropertyWindow.setWidth(800);
editPropertyWindow.setAutoCenter(true);

相关文章