@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); } } };
@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); } } };
messageLabel.getElement().getStyle().setProperty("maxHeight", "400px"); messageLabel.getElement().getStyle() .setProperty("maxWidth", Window.getClientWidth() * 2 / 3 + "px"); messageLabel.getElement().getStyle().setOverflowY(Overflow.AUTO); messageLabel.setMessage(message);
/** * @deprecated As of GWT 1.5, replaced by {@link Window#getClientWidth()} */ @Deprecated public static int windowGetClientWidth() { return Window.getClientWidth(); }
private int getClientRight() { return getClientLeft() + Window.getClientWidth(); } }
private void setPositionInClient(int left, int top) { // Keep the popup inside client area if (getOffsetWidth() < Window.getClientWidth()) { left = Math.min(left, getClientRight() - getOffsetWidth()); left = Math.max(getClientLeft(), left); } setPopupPosition(left, top); }
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); } } }
private void resize() { contentPanel.setWidth(Window.getClientWidth() * 0.90 + "px"); contentPanel.setHeight(Window.getClientHeight() * 0.90 + "px"); contentPanel.getElement().getStyle().setProperty("overflow", "auto"); } }
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); } };
elem.getStyle().setPropertyPx("top", 0); int left = (Window.getClientWidth() - getOffsetWidth()) >> 1; int top = (Window.getClientHeight() - getOffsetHeight()) >> 1; setPopupPosition(Math.max(Window.getScrollLeft() + left, 0), Math.max(
int windowRight = Window.getClientWidth() + Window.getScrollLeft(); int windowLeft = Window.getScrollLeft(); int windowRight = Window.getClientWidth() + Window.getScrollLeft(); int windowLeft = Window.getScrollLeft();
/** * By default this method centers the popup horizontally. * You can override this method to change the horizontal position of the popup. * @param popupWidth the width of the popup * @return the left position of the popup */ protected int getLeft(int popupWidth) { return ((Window.getClientWidth() - popupWidth) / 2) + Window.getScrollLeft(); }
int width = Math.max(Window.getClientWidth(), Document.get().getScrollWidth()); int height = Math.max(Window.getClientHeight(),
windowWidth = Window.getClientWidth(); clientLeft = Document.get().getBodyOffsetLeft(); clientTop = Document.get().getBodyOffsetTop();
/** * Displays the popup. */ public void show() { Point p = new Point((int) Window.getClientWidth() / 2, (int) Window.getClientHeight() / 2); showAt(p.x, p.y); }
private void setPositionInClient(int left, int top) { // Keep the popup inside client area if (getOffsetWidth() < Window.getClientWidth()) { left = Math.min(left, getClientRight() - getOffsetWidth()); left = Math.max(getClientLeft(), left); } setPopupPosition(left, top); }
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); }
public void setPosition(int offsetWidth, int offsetHeight) { int left = 0; if (parent.getDock().getDockPosition() == UberfireDockPosition.EAST) { left = Window.getClientWidth() - getOffsetWidth(); } int top = parent.getAbsoluteTop(); setPopupPosition(left, top); } });
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; }
/** * Shows the panel. */ public void lock() { setStyleName("advanced-LockingPanel"); setPopupPosition(0, 0); setWidth("100%"); setHeight("100%"); setPixelSize(Window.getClientWidth(), Window.getClientHeight()); show(); }