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

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

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

Window.setKeepInParentRect介绍

[英]If Window.canDragReposition or Window.canDragRShowcaseDataesize is true, should the windows size and position be constrained such that it remains within the viewport of its parent element (or for top level windows, within the viewport of the browser window)? Can also be set to an array denoting an arbitrary Rectangle beyond which the window cannot be moved.
Note: keepInParentRect affects only user drag interactions, not programmatic moves.
[中]如果有窗户。重新定位或打开窗口。canDragRShowcaseDataesize为true时,是否应约束窗口大小和位置,使其保持在其父元素的视口中(或对于顶层窗口,保持在浏览器窗口的视口中)?也可以设置为一个数组,表示窗口不能移动到任意矩形之外。
注意:keepInParentRect只影响用户拖动交互,而不影响编程移动。

代码示例

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

private void showFeatureInfo(Map<String, List<org.geomajas.layer.feature.Feature>> featureMap) {
  if (featureMap.size() > 0) {
    if (featureMap.size() == 1 && featureMap.values().iterator().next().size() == 1) {
      Layer<?> layer = (mapWidget.getMapModel().getLayer(featureMap.keySet().iterator().next()));
      if (null != layer) {
        org.geomajas.layer.feature.Feature featDTO = featureMap.values().iterator().next().get(0);
        Feature feature;
        if (layer instanceof VectorLayer) {
          feature = new Feature(featDTO, (VectorLayer) layer);
        } else {
          feature = new Feature(featDTO, null);
        }
        Window window = FeatureDetailWidgetFactory.createFeatureDetailWindow(feature, layer, false);
        window.setPageTop(mapWidget.getAbsoluteTop() + 25);
        window.setPageLeft(mapWidget.getAbsoluteLeft() + 25);
        window.setKeepInParentRect(true);
        window.draw();
      } else {
        Notify.error(MESSAGES.multiLayerFeatureInfoLayerNotFound());
      }
    } else {
      Window window = new MultiLayerFeatureInfoWindow(mapWidget, featureMap, featuresListLabels);
      window.setPageTop(mapWidget.getAbsoluteTop() + 10);
      window.setPageLeft(mapWidget.getAbsoluteLeft() + 50);
      window.draw();
    }
  } else {
    Notify.info(MESSAGES.multiLayerFeatureInfoNoResult());
  }
}

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

public void onClick(Feature feature, Layer layer) {
  Window window = FeatureDetailWidgetFactory.createFeatureDetailWindow(feature, layer, false);
  window.setPageTop(mapWidget.getAbsoluteTop() + 25);
  window.setPageLeft(mapWidget.getAbsoluteLeft() + 25);
  window.setKeepInParentRect(true);
  window.draw();
}

代码示例来源: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.widget/geomajas-widget-searchandfilter-gwt

window.setAutoSize(true);
window.show();
window.setKeepInParentRect(true);

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

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

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

addWindow.setShowMinimizeButton(false);
addWindow.setIsModal(true);
addWindow.setKeepInParentRect(true);

相关文章