Example usage for com.google.gwt.user.client Window getClientHeight

List of usage examples for com.google.gwt.user.client Window getClientHeight

Introduction

In this page you can find the example usage for com.google.gwt.user.client Window getClientHeight.

Prototype

public static int getClientHeight() 

Source Link

Usage

From source file:cc.kune.sandbox.client.KuneSandboxEntryPoint.java

License:GNU Affero Public License

/**
 * Test tooltips.//  w w w . j a  v  a 2  s .co m
 */
private void testTooltips() {

    final Button button = new Button("Btn 1 biiggggggg");
    final Button button2 = new Button("Btn 2 also biggggg");
    button2.getElement().getStyle().setWhiteSpace(WhiteSpace.NORMAL);

    final IconLabel button3 = new IconLabel(res.info(), "Btn 3");
    final Button button4 = new Button("Btn 4");

    final int clientWidth = Window.getClientWidth();
    final int clientHeight = Window.getClientHeight();
    absolutePanel.setSize(String.valueOf(clientWidth - 10) + "px", String.valueOf(clientHeight - 10) + "px");
    absolutePanel.add(button, 5, 5);
    absolutePanel.add(button2, clientWidth - 90, 5);
    absolutePanel.add(button3, 5, clientHeight - 50);
    absolutePanel.add(button4, clientWidth - 90, clientHeight - 60);
    Tooltip.to(button,
            "Some tooltip, Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec vitae eros. ");
    Tooltip.to(button2,
            "Some tooltip, Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec vitae eros. ");
    Tooltip.to(button3,
            "Some tooltip, Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec vitae eros. ");
    Tooltip.to(button4,
            "Some tooltip, Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec vitae eros. ");

}

From source file:cc.kune.wave.client.kspecific.WaveUnsaveNotificator.java

License:GNU Affero Public License

/**
 * Show.//from ww w .j  av a2 s . c  o  m
 *
 * @param message the message
 */
public void show(final String message) {
    msg.setText(message);
    popupPalette = new PopupPanel(true, false);
    popupPalette.setWidget(msg);
    popupPalette.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
        public void setPosition(final int offsetWidth, final int offsetHeight) {
            popupPalette.setPopupPosition(Window.getClientWidth() - msg.getOffsetWidth() + 1,
                    Window.getClientHeight() - msg.getOffsetHeight() + 1);
        }
    });
    popupPalette.setStyleName("oc-user-msg-popup");
    popupPalette.setAnimationEnabled(false);
}

From source file:ch.sebastienzurfluh.swissmuseum.parcours.client.view.bookletnavigator.BookletNavigator.java

License:Open Source License

public BookletNavigator(EventBus eventBus, Model model) {
    this.model = model;
    this.eventBus = eventBus;

    /**/*from w w  w. j a v  a  2 s .  c o m*/
     * We need only one parser for all the pages
     */
    this.textParser = new TextParser(eventBus, model);

    carousel = new InteractiveCarousel(eventBus, model);
    add(carousel);

    // Needed for the panel to show properly!
    this.setHeight(Window.getClientHeight() + "px");
    carousel.setHeight(Window.getClientHeight() + "px");

    model.allPagesMenusInCurrentGroupObservable.subscribeObserver(this);
}

From source file:ch.sebastienzurfluh.www.client.Mia_retumejo.java

License:Open Source License

public void onModuleLoad() {

    SimplaArtMuro artMuro = new SimplaArtMuro(Window.getClientWidth(), Window.getClientHeight());
    artMuro.setStyleName("artMuro");

    artMuro.aldoni(new RandAfisxo(new Image("resources/pix/light_blue.gif"), 200, 200, 20));

    artMuro.aldoni(new RandAfisxo(new Image("resources/pix/light_green.gif"), 200, 600, 20));

    artMuro.aldoni(new RandAfisxo(new Image("resources/pix/light_violet.gif"), 150, 350, 20));

    artMuro.aldoni(new RandAfisxo(new Image("resources/pix/light_yellow.gif"), 100, 150, 20));

    artMuro.aldoni(new RandAfisxo(new Image("resources/pix/light_blue.gif"), 150, 200, 20));

    artMuro.aldoni(new RandAfisxo(new Image("resources/pix/light_green.gif"), 250, 350, 20));

    artMuro.aldoni(new RandAfisxo(new Image("resources/pix/light_violet.gif"), 250, 250, 20));

    artMuro.aldoni(new RandAfisxo(new Image("resources/pix/light_blue.gif"), 30, 10, 20));

    RootPanel.get().add(artMuro);//  w w w  . j a  v  a2  s  . c o m
}

From source file:ch.unifr.pai.twice.dragndrop.client.configuration.DragConfiguration.java

License:Apache License

/**
 * @return the boundaries of permitted drags - if no boundary box is provided, this equals to the client height
 *//*from  w w  w  . jav  a 2  s.com*/
public int getMaxY() {
    return boundaryBox != null ? boundaryBox.getAbsoluteTop() + boundaryBox.getOffsetHeight()
            : Window.getClientHeight();
}

From source file:ch.unifr.pai.twice.multipointer.client.ExtendedWebsocketControl.java

License:Apache License

/**
 * As soon as the web socket channel is opened, the component sends its screen dimensions to the server
 *//*  w ww. ja va 2 s  .  c  om*/
private void onOpen() {
    this.opened = true;
    send(websocket, UUID.get() + "@s@" + Window.getClientWidth() + "@" + Window.getClientHeight());
    // Window.alert("Multi cursor control started!");
}

From source file:ch.unifr.pai.twice.multipointer.client.ExtendedWebsocketControl.java

License:Apache License

/**
 * If the screen of the shared device is resized, the component updates the information on the server side.
 * //from   ww w  .ja  v  a 2s.co  m
 * @see com.google.gwt.event.logical.shared.ResizeHandler#onResize(com.google.gwt.event.logical.shared.ResizeEvent)
 */
@Override
public void onResize(ResizeEvent event) {
    if (opened && websocket != null) {
        send(websocket, UUID.get() + "@r@" + Window.getClientWidth() + "@" + Window.getClientHeight());
    }
}

From source file:ch.unifr.pai.twice.multipointer.client.MouseCursor.java

License:Apache License

/**
 * Reposition the mouse pointer to x and y coordinates
 * /* w w w .java2  s .  com*/
 * @param x
 * @param y
 */
private void move(int x, int y) {
    this.x = x;
    this.y = y;
    Element e = getElementFromPoint(x, y);
    int shrinkX = x + image.getOffsetWidth() - Window.getClientWidth() - Window.getScrollLeft();
    int shrinkY = y + image.getOffsetHeight() - Window.getClientHeight() - Window.getScrollTop();
    setWidth(Math.max(0, (image.getOffsetWidth() - (shrinkX > 0 ? shrinkX : 0))) + "px");
    setHeight(Math.max(0, (image.getOffsetHeight() - (shrinkY > 0 ? shrinkY : 0))) + "px");
    int clientX = x + Window.getScrollLeft();
    int clientY = y + Window.getScrollTop();
    if (!e.equals(oldElement)) {
        if (oldElement != null)
            fireMouseEvent("mouseout", uuid, color, oldElement, clientX, clientY);
        fireMouseEvent("mouseover", uuid, color, e, clientX, clientY);
    }
    fireMouseEvent("mousemove", uuid, color, e, clientX, clientY);
    oldElement = e;
    getElement().getStyle().setLeft(x, Unit.PX);
    getElement().getStyle().setTop(y, Unit.PX);
    if (storage != null) {
        storage.setItem("ch.unifr.pai.mice.multicursor.position." + fileName + ".x", String.valueOf(x));
        storage.setItem("ch.unifr.pai.mice.multicursor.position." + fileName + ".y", String.valueOf(y));
    }
}

From source file:ch.unifr.pai.twice.multipointer.client.WebsocketControl.java

License:Apache License

private void onOpen() {
    this.opened = true;
    send(websocket, UUID.get() + "@s@" + Window.getClientWidth() + "@" + Window.getClientHeight());
    // Window.alert("Multi cursor control started!");
}

From source file:ch.unifr.pai.twice.multipointer.client.WebsocketControl.java

License:Apache License

@Override
public void onResize(ResizeEvent event) {
    if (opened && websocket != null) {
        send(websocket, UUID.get() + "@r@" + Window.getClientWidth() + "@" + Window.getClientHeight());
    }/*from  w w w.  j  a v a  2  s  .  c om*/
}