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:com.qualogy.qafe.gwt.client.ui.renderer.WindowRenderer.java

License:Apache License

public UIObject render(ComponentGVO component, String uuid, String parent, String context) {
    QRootPanel qRootPanel = null;/*from   ww w . j  a  v  a 2 s  . c  o  m*/
    if (component != null) {
        if (component instanceof WindowGVO) {
            WindowGVO gvo = (WindowGVO) component;
            qRootPanel = new QRootPanel();
            RendererHelper.addId(component, qRootPanel, uuid, parent, context, false);
            RendererHelper.addUUID(component, qRootPanel, uuid);
            RendererHelper.addEvents(component, qRootPanel, uuid);

            Widget rootPanel = (Widget) super.renderChildComponent(gvo.getRootPanel(), uuid, gvo.getId(),
                    context);
            Widget menuAndToolbar = createMenuAndToolbar(qRootPanel, gvo.getRootPanel(), uuid, parent);
            Widget messageBox = new MessageBox();

            ScrollPanel sp = new ScrollPanel();
            if (ClientApplicationContext.getInstance().isMDI()) {
                sp.setHeight(gvo.getHeight());
                sp.setWidth(gvo.getWidth());
            } else {
                sp.setHeight(Window.getClientHeight() + "px");
                sp.setWidth(Window.getClientWidth() + "px");
            }
            sp.add(rootPanel);

            qRootPanel.setMenuAndToolBar(menuAndToolbar);
            qRootPanel.setRootPanel(sp);
            qRootPanel.setMessageBox(messageBox);
            qRootPanel.add(menuAndToolbar, 0, 0);
            int yPosition = toolbarHeight != null ? Integer.parseInt(toolbarHeight) + 20 : 0;
            if (qRootPanel.getMenuBar() != null) {
                yPosition += 22;
            }
            qRootPanel.add(sp, 0, yPosition);

            qRootPanel.add(messageBox, 200, 0);
        }
    }
    return qRootPanel;
}

From source file:com.qualogy.qafe.gwt.client.vo.handlers.OpenWindowHandler.java

License:Apache License

private void calculateCenterCascade(final Map<String, String> paramMap, final boolean external) {
    final int width = getWidth(paramMap, 0);
    final int height = getHeight(paramMap, 0);
    final int startLeft = ((Window.getClientWidth() - width) / 2);
    final int startTop = ((Window.getClientHeight() - height) / 2);
    calculateCascadePosition(paramMap, startLeft, startTop, external);
}

From source file:com.risevision.ui.client.common.widgets.text.TextEditorWidget.java

License:Open Source License

public void resizeTextArea(int width, int height) {
    int outerWidth, outerHeight;
    int verticalScroll = 0;
    if (height > Window.getClientHeight() - 320) {
        outerHeight = Window.getClientHeight() - 320;
        verticalScroll = 16;//from  w w w.  ja va 2s.  co  m
    } else {
        outerHeight = height + 10;
    }

    if (width < 465 - 10 - verticalScroll) {
        outerWidth = 465;
    } else if (width > Window.getClientWidth() - 160 - verticalScroll) {
        outerWidth = Window.getClientWidth() - 160;
    } else {
        outerWidth = width + 10 + verticalScroll;
    }

    textAreaScrollPanel.setSize(outerWidth + "px", outerHeight + "px");

    textAreaInnerPanel.setPixelSize(width + 10, height + 10);
    textAreaBackgroundPanel.setPixelSize(width, height);
    textArea.setPixelSize(width, height);

    htmlEditor.setSize(Math.max(outerWidth, 500) + "px", Math.max((outerHeight + 53), 175) + "px");
}

From source file:com.risevision.ui.client.UiControlBinder.java

License:Open Source License

private void styleControls() {
    startFrame.getElement().getStyle().setHeight((int) (Window.getClientHeight() - 145), Unit.PX);
    startFrame.getElement().getStyle().setWidth((int) (Window.getClientWidth() - 29), Unit.PX);
    startFrame.getElement().getStyle().setBorderWidth(0, Unit.PX);
    startFrame.getElement().setAttribute("frameBorder", "0px");
    startFrame.getElement().setAttribute("allowTransparency", "true");

    contentDeckPanel.getElement().getStyle().setHeight(100, Unit.PCT);
}

From source file:com.risevision.viewer.client.controller.ViewerGadgetController.java

License:Open Source License

private String updateUrlParams(String urlParams) {
    int height, width;
    //      int top = 0, left = 0;
    urlParams = removeIdParameter(urlParams);
    //      urlParams = addVersionNumber(urlParams);

    if (placeholderInfo.getWidthUnits().equals("%")) {
        width = (int) ((placeholderInfo.getWidth() / 100.0) * Window.getClientWidth());
    } else {//from ww w.  ja v a2  s . c  o  m
        width = (int) placeholderInfo.getWidth();
    }
    //         
    if (placeholderInfo.getHeightUnits().equals("%")) {
        height = (int) ((placeholderInfo.getHeight() / 100.0) * Window.getClientHeight());
    } else {
        height = (int) placeholderInfo.getHeight();
    }

    urlParams += "&up_rsW=" + width;
    urlParams += "&up_rsH=" + height;

    //"&pid=test1&up_id=test1"
    //      urlParams += "&pid=" + htmlName;
    urlParams += "&up_id=" + htmlName;
    //      urlParams += "&parent=" + URL.encodeQueryString(Window.Location.getHref());
    //      urlParams += ViewerEntryPoint.getDisplayId().isEmpty() ? "": "&up_displayid=" + ViewerEntryPoint.getDisplayId();

    urlParams = urlParams.replace("'", "\\'");

    return urlParams;
}

From source file:com.risevision.viewer.client.controller.ViewerPresentationController.java

License:Open Source License

private void addPresentation() {
    int height = Window.getClientHeight();
    int width = Window.getClientWidth();
    int top = 0, left = 0;
    //      double scale = ViewerUtils.getItemScale(item.getScale());

    //      height = (int)(Window.getClientHeight() * scale);
    //      width = (int)(Window.getClientWidth() * scale);

    //        top = ViewerUtils.getPositionTop(item.getPosition(), 0, Window.getClientHeight(), height);
    //        left = ViewerUtils.getPositionLeft(item.getPosition(), 0, Window.getClientWidth(), width);

    if (items.get(0).getType().equals(PlaylistItemInfo.TYPE_PRESENTATION)) {
        ViewerHtmlUtils.addPresentation(htmlName, containerName, width, height, top, left,
                presentation.getLayout(), presentation.getWidth() + presentation.getWidthUnits(),
                presentation.getHeight() + presentation.getHeightUnits(),
                (presentation.getHidePointer() && ViewerEntryPoint.isDisplay()),
                !ViewerEntryPoint.isDisplay() && !ViewerEntryPoint.isEmbed());

        // set presentation size in the entry point to make it available for Embed IFrame size
        ViewerEntryPoint.setPresentationSize(presentation.getWidth(), presentation.getHeight());
    } else {//from w  ww.j ava 2s.  co m
        ViewerHtmlUtils.addUrl(htmlName, containerName, width, height, top, left, items.get(0).getObjectRef());
    }

    // Timer that will cut loading to a maximum of 20 seconds.
    readyTimer.schedule(20 * 1000);

    status = ADDED_STATUS;
}

From source file:com.risevision.viewer.client.controller.ViewerScheduleController.java

License:Open Source License

private void onWindowResize() {
    int height = Window.getClientHeight();
    int width = Window.getClientWidth();
    //      double scale = ViewerUtils.getItemScale(schedule.getScale());

    //      height = (int)(Window.getClientHeight() * scale);
    //      width = (int)(Window.getClientWidth() * scale);

    //      ViewerHtmlUtils.resizeContainer("sc" + thisCount, width, height);
    for (int i = 0; i < presentations.size(); i++) {
        //         ViewerHtmlUtils.resizeContainer("sc" + thisCount + "_pre" + i, width, height);

        // [ad] bug fix - automatically re-size URL iframe size as well
        if (items.get(i).getType().equals(PlaylistItemInfo.TYPE_URL)) {
            ViewerHtmlUtils.resizeContainer("iFrame_sc" + thisCount + "_pre" + i, width, height);
        }//from www. jav a 2 s  . c o  m
    }
}

From source file:com.risevision.viewer.client.controller.ViewerWidgetController.java

License:Open Source License

private String updateUrlParams(String urlParams) {
    int height, width;
    //      int top = 0, left = 0;
    //      urlParams = removeIdParameter(urlParams);
    //      urlParams = addVersionNumber(urlParams);

    if (placeholderInfo.getWidthUnits().equals("%")) {
        width = (int) ((placeholderInfo.getWidth() / 100.0) * Window.getClientWidth());
    } else {/*from w  ww.j av  a 2s .  c om*/
        width = (int) placeholderInfo.getWidth();
    }

    if (placeholderInfo.getHeightUnits().equals("%")) {
        height = (int) ((placeholderInfo.getHeight() / 100.0) * Window.getClientHeight());
    } else {
        height = (int) placeholderInfo.getHeight();
    }

    //"&pid=test1&up_id=test1"
    //      urlParams += "&pid=" + htmlName;
    urlParams += urlParams.contains("?") ? "&" : "?";
    urlParams += "up_id=" + htmlName;
    urlParams += "&parent=" + URL.encodeQueryString(Window.Location.getHref());
    urlParams += "&up_rsW=" + width;
    urlParams += "&up_rsH=" + height;

    String displayId = ViewerEntryPoint.getDisplayId();
    if (displayId != null && !displayId.isEmpty()) {
        urlParams += "&up_displayId=" + displayId;
    }

    urlParams = urlParams.replace("'", "\\'");

    return urlParams;
}

From source file:com.risevision.viewer.client.data.DisplayRegistrationController.java

License:Open Source License

public static void registerDisplay(String claimId, String displayName) {
    // API: /v2/viewer/display/{claimId}/register?callback={callbackName}&name={displayName}
    //      callbackName is mandatory, displayName is optional.
    int viewerWidth = Window.getClientWidth();
    int viewerHeight = Window.getClientHeight();

    String url = Global.DATA_SERVER_URL.replace("{0}", "display");
    url = url.replace("{1}", claimId);
    url += "/register?width=" + viewerWidth + "&height=" + viewerHeight;
    if (displayName != null && !displayName.isEmpty()) {
        url += "&name=" + URL.encodeQueryString(displayName);
    }/*from   w w w. ja  v  a2  s.  c  om*/
    url += "&callback=?";
    callUrlNative(url, MODE_REGISTER);
}

From source file:com.risevision.viewer.client.data.ViewerDataProvider.java

License:Open Source License

public static void retrieveData(String reason) {
    if (state == IDLE_STATE) {
        // [AD] moved this function to after the data is retrieved - workaround for Core bug 
        // where the Viewer API and Channel Token calls can't be made at the same time 
        //         channelController.init(channelCommand);

        String url;/*  ww  w  .j  a v  a 2 s  . co  m*/

        url = Global.DATA_SERVER_URL.replace("{0}", ViewerEntryPoint.getType());
        url = url.replace("{1}", ViewerEntryPoint.getId());

        int viewerWidth = Window.getClientWidth();
        int viewerHeight = Window.getClientHeight();

        String sysInfo = ViewerEntryPoint.getSysInfo();
        JsArrayString browserInfo = ViewerHtmlUtils.getBrowserVersion();

        String updateTicket = ChannelConnectionController.getUpdateTicket();
        updateTicket = updateTicket == null ? "" : "&ticket=" + updateTicket;

        String fullUrl = url + "?sig=" + ViewerDataController.getSig() + updateTicket + "&"
                + Global.VIEWER_URL_IDENTIFIER
                + (RiseUtils.strIsNullOrEmpty(sysInfo) ? "" : "&" + URL.decodeQueryString(sysInfo)) + "&cn="
                + browserInfo.get(0) + "&cv=" + browserInfo.get(1) + "&width=" + viewerWidth + "&height="
                + viewerHeight + "&callback=?";

        state = WAITING_STATE;

        // start 60 second timer for timeout of data retrieval
        apiTimer.schedule(ViewerDataController.MINUTE_UPDATE_INTERVAL);
        ViewerHtmlUtils.logExternalMessage("viewer data retrieval", reason);
        getDataNative(fullUrl);
    } else {
        state = CONTENT_STATE;
    }
}