com.google.gwt.user.client.Window.getClientHeight()方法的使用及代码示例

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

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

Window.getClientHeight介绍

[英]Gets the height of the browser window's client area excluding the scroll bar.
[中]获取浏览器窗口的客户端区域(不包括滚动条)的高度。

代码示例

代码示例来源:origin: libgdx/libgdx

@Override
  public void run () {
    // Ignore changes that result from window resize events
    if (windowHeight != Window.getClientHeight() || windowWidth != Window.getClientWidth()) {
      windowHeight = Window.getClientHeight();
      windowWidth = Window.getClientWidth();
      schedule(resizeCheckDelay);
      return;
    }
    // Look for elements that have new dimensions
    checkWidgetSize();
    // Start checking again
    if (resizeCheckingEnabled) {
      schedule(resizeCheckDelay);
    }
  }
};

代码示例来源:origin: libgdx/libgdx

@Override
  public void run () {
    // Ignore changes that result from window resize events
    if (windowHeight != Window.getClientHeight() || windowWidth != Window.getClientWidth()) {
      windowHeight = Window.getClientHeight();
      windowWidth = Window.getClientWidth();
      schedule(resizeCheckDelay);
      return;
    }
    // Look for elements that have new dimensions
    checkWidgetSize();
    // Start checking again
    if (resizeCheckingEnabled) {
      schedule(resizeCheckDelay);
    }
  }
};

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * @deprecated As of GWT 1.5, replaced by {@link Window#getClientHeight()}
 */
@Deprecated
public static int windowGetClientHeight() {
 return Window.getClientHeight();
}

代码示例来源:origin: com.google.gwt/gwt-servlet

static void onResize() {
 if (resizeHandlersInitialized) {
  // On webkit and IE we sometimes get duplicate window resize events.
  // Here, we manually filter them.
  int width = getClientWidth();
  int height = getClientHeight();
  if (lastResizeWidth != width || lastResizeHeight != height) {
   lastResizeWidth = width;
   lastResizeHeight = height;
   ResizeEvent.fire(getHandlers(), width, height);
  }
 }
}

代码示例来源:origin: org.jboss.errai/errai-bus

private void resize() {
  contentPanel.setWidth(Window.getClientWidth() * 0.90 + "px");
  contentPanel.setHeight(Window.getClientHeight() * 0.90 + "px");
  contentPanel.getElement().getStyle().setProperty("overflow", "auto");
 }
}

代码示例来源:origin: com.google.gwt/gwt-servlet

public void onResize(ResizeEvent event) {
  Style style = glass.getStyle();
  int winWidth = Window.getClientWidth();
  int winHeight = Window.getClientHeight();
  // Hide the glass while checking the document size. Otherwise it would
  // interfere with the measurement.
  style.setDisplay(Display.NONE);
  style.setWidth(0, Unit.PX);
  style.setHeight(0, Unit.PX);
  int width = Document.get().getScrollWidth();
  int height = Document.get().getScrollHeight();
  // Set the glass size to the larger of the window's client size or the
  // document's scroll size.
  style.setWidth(Math.max(width, winWidth), Unit.PX);
  style.setHeight(Math.max(height, winHeight), Unit.PX);
  // The size is set. Show the glass again.
  style.setDisplay(Display.BLOCK);
 }
};

代码示例来源:origin: org.drools/drools-wb-guided-rule-editor-client

/**
   * Height of pop-up, 1/2 of the client height or MIN_HEIGHT
   * @return
   */
  protected int getChoicesHeight() {
    int h = Window.getClientHeight() / 2;
    if (h < MIN_HEIGHT) {
      h = MIN_HEIGHT;
    }
    return h;
  }
}

代码示例来源:origin: org.kie.guvnor/guvnor-guided-dtable-editor-client

/**
 * Height of pop-up, 75% of the client height or MIN_HEIGHT
 * @return
 */
protected int getPopupHeight() {
  int h = (int) ( Window.getClientHeight() * 0.75 );
  if ( h < MIN_HEIGHT ) {
    h = MIN_HEIGHT;
  }
  return h;
}

代码示例来源:origin: com.google.gwt/gwt-servlet

int top = (Window.getClientHeight() - getOffsetHeight()) >> 1;
setPopupPosition(Math.max(Window.getScrollLeft() + left, 0), Math.max(
  Window.getScrollTop() + top, 0));

代码示例来源:origin: ArcBees/GWTP

/**
   * By default this method centers the popup vertically.
   * You can override this method to change the vertical position of the popup.
   * @param popupHeight the height of the popup
   * @return the top position of the popup.
   */
  protected int getTop(int popupHeight) {
    return ((Window.getClientHeight() - popupHeight) / 2) + Window.getScrollTop();
  }
}

代码示例来源:origin: org.xwiki.platform/xwiki-platform-gwt-api

public static void setMaxHeight(Widget widget) {
  int absoluteTop = getAbsoluteTop(widget);
  int newHeight = (Window.getClientHeight() - absoluteTop);
  if (newHeight>0)  {
    try {
      widget.setHeight(newHeight + "px");
    } catch (Exception e) {
      // We need to catch this call since in IE7
      // it seems to be able to break sometime on initial loading
    }
  }
}

代码示例来源:origin: de.esoco/gewt

/***************************************
 * Returns the bounding rectangle of this device.
 *
 * @return The bounding rectangle
 */
public Rectangle getBounds()
{
  return new Rectangle(0,
             0,
             Window.getClientWidth(),
             Window.getClientHeight());
}

代码示例来源:origin: com.google.gwt/gwt-servlet

int height = Math.max(Window.getClientHeight(),
  Document.get().getScrollHeight());
glassElem.getStyle().setHeight(height, Unit.PX);

代码示例来源:origin: com.google.gwt/gwt-servlet

int windowBottom = Window.getScrollTop() + Window.getClientHeight();

代码示例来源:origin: com.extjs/gxt

/**
 * Displays the popup.
 */
public void show() {
 Point p = new Point((int) Window.getClientWidth() / 2, (int) Window.getClientHeight() / 2);
 showAt(p.x, p.y);
}

代码示例来源:origin: org.kuali.student.core/ks-common-ui

@Override
  public void execute() {
    resizeDialog();
    int left = (Window.getClientWidth() - getOffsetWidth()) >> 1;
    int top = (Window.getClientHeight() - getOffsetHeight()) >> 1;
    setPopupPosition(Math.max(Window.getScrollLeft() + left, 0), Math.max(
        Window.getScrollTop() + top, 0));
  }
});

代码示例来源:origin: com.ahome-it/lienzo-core

public LienzoPanel(final Viewport view)
{
  if (false == view.adopt(this))
  {
    throw new IllegalArgumentException("Viewport is already adopted.");
  }
  m_view = view;
  setWidth("100%");
  setHeight("100%");
  doPostCTOR(Window.getClientWidth(), Window.getClientHeight(), true);
}

代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit

private boolean cursorInsideBrowserContentArea(Event event) {
  if (event.getClientX() < 0 || event.getClientY() < 0) {
    // Outside to the left or above
    return false;
  }
  if (event.getClientX() > Window.getClientWidth()
      || event.getClientY() > Window.getClientHeight()) {
    // Outside to the right or below
    return false;
  }
  return true;
}

代码示例来源:origin: net.sf.advanced-gwt/advanced-gwt

/**
 * Shows the panel.
 */
public void lock() {
  setStyleName("advanced-LockingPanel");
  setPopupPosition(0, 0);
  setWidth("100%");
  setHeight("100%");
  setPixelSize(Window.getClientWidth(), Window.getClientHeight());
  show();
}

代码示例来源:origin: org.kie.guvnor/guvnor-commons-ui

public NewResourceView() {
  setTitle( NewItemPopupConstants.INSTANCE.popupTitle() );
  setMaxHeigth( ( Window.getClientHeight() * 0.75 ) + "px" );
  setBackdrop( BackdropType.STATIC );
  setKeyboard( true );
  setAnimation( true );
  setDynamicSafe( true );
  footer.enableOkButton( false );
  add( uiBinder.createAndBindUi( this ) );
  add( footer );
}

相关文章