@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); } } };
/** * @deprecated As of GWT 1.5, replaced by {@link Window#getClientHeight()} */ @Deprecated public static int windowGetClientHeight() { return Window.getClientHeight(); }
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); } };
/** * 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; } }
/** * 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; }
int top = (Window.getClientHeight() - getOffsetHeight()) >> 1; setPopupPosition(Math.max(Window.getScrollLeft() + left, 0), Math.max( Window.getScrollTop() + top, 0));
/** * 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(); } }
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 } } }
/*************************************** * Returns the bounding rectangle of this device. * * @return The bounding rectangle */ public Rectangle getBounds() { return new Rectangle(0, 0, Window.getClientWidth(), Window.getClientHeight()); }
int height = Math.max(Window.getClientHeight(), Document.get().getScrollHeight()); glassElem.getStyle().setHeight(height, Unit.PX);
int windowBottom = Window.getScrollTop() + Window.getClientHeight();
/** * Displays the popup. */ public void show() { Point p = new Point((int) Window.getClientWidth() / 2, (int) Window.getClientHeight() / 2); showAt(p.x, p.y); }
@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)); } });
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); }
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(); }
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 ); }