List of usage examples for com.google.gwt.user.client Window getClientHeight
public static int getClientHeight()
From source file:edu.caltech.ipac.firefly.visualize.WebMouseReadout.java
private ScreenPt adjustXY(int x, int y) { int popWidth = _popupPanel.getPopupPanel().getOffsetWidth(); int popHeight = _popupPanel.getPopupPanel().getOffsetHeight(); int bWidth = Window.getClientWidth(); int bHeight = Window.getClientHeight(); int sx = Window.getScrollLeft(); int sy = Window.getScrollTop(); if (x + popWidth > bWidth) x = (bWidth - popWidth) + sx;//from ww w . j ava2 s. co m if (y + popHeight > bHeight) y = (bHeight - popHeight) + sy; if (x < sx) x = sx; if (y < sy) y = sy; return new ScreenPt(x, y); }
From source file:edu.oswego.csc480_hci521_2013.client.activity.DoublePanelActivity.java
License:Apache License
private void popoutConfusionMatrixTab(ConfusionMatrixPlace place, int id) { // FIXME: this needs to be injected... AppPlaceHistoryMapper historyMapper = Entry.getPlaceHistoryMapper(); String token = historyMapper.getToken(place); String url = Window.Location.createUrlBuilder().setHash(token).buildString(); int width = Window.getClientWidth() / 2; int height = Window.getClientHeight() / 2; String features = "width=" + width + ",height=" + height + ",menubar=0,location=0,toolbar=0,status=0"; ConfusionMatrixActivity.openPanel(this, url, "_blank", features, Integer.toString(id)); }
From source file:edu.oswego.csc480_hci521_2013.client.activity.DoublePanelActivity.java
License:Apache License
private void popoutTreeVisTab(TreeVisPlace place, int id) { // FIXME: this needs to be injected... AppPlaceHistoryMapper historyMapper = Entry.getPlaceHistoryMapper(); String token = historyMapper.getToken(place); String url = Window.Location.createUrlBuilder().setHash(token).buildString(); int width = Window.getClientWidth() / 2; int height = Window.getClientHeight() / 2; String features = "width=" + width + ",height=" + height + ",menubar=0,location=0,toolbar=0,status=0"; TreeVisActivity.openPanel(this, url, "_blank", features, Integer.toString(id)); }
From source file:edu.oswego.csc480_hci521_2013.client.activity.DoublePanelActivity.java
License:Apache License
private void popoutDataTab(DataTablePlace place, int id) { logger.log(Level.INFO, "Popping data panel: " + place.getDataKey()); // FIXME: this needs to be injected... AppPlaceHistoryMapper historyMapper = Entry.getPlaceHistoryMapper(); String token = historyMapper.getToken(place); String url = Window.Location.createUrlBuilder().setHash(token).buildString(); int width = Window.getClientWidth() / 2; int height = Window.getClientHeight() / 2; String features = "width=" + width + ",height=" + height + ",menubar=0,location=0,toolbar=0,status=0"; DataPanelActivity.openPanel(this, url, "_blank", features, Integer.toString(id)); }
From source file:edu.ucla.loni.pipeline.client.Charts.LineChartPanel.java
License:Open Source License
private void initialize(String mt) { monitorType = mt;// ww w .ja v a2 s. c o m if (monitorType.equals("Memory")) { initializeMemory(); } else if (monitorType.equals("Thread")) { initializeThread(); } else { System.err.println( "Incorrect monitorType provided. Check initialize() in LineChartPanel.java for errors."); return; } // set up chart ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART); chartLoader.loadApi(new Runnable() { @Override public void run() { // Create and attach the chart chart = new LineChart(); int height = Window.getClientHeight() - 330; int width = Window.getClientWidth() - 75; chart.setSize(width + "px", height + "px"); // listen to resize events Window.addResizeHandler(new ResizeHandler() { @Override public void onResize(ResizeEvent event) { int height = event.getHeight() - 330; int width = event.getWidth() - 75; chart.setHeight(height + "px"); chart.setWidth(width + "px"); draw(); } }); addChild(chart); draw(); } }); }
From source file:edu.ucsc.robot.client.MainScreen.java
License:Apache License
@Override public void onModuleLoad() { screenWidth = Window.getClientWidth(); screenHeight = Window.getClientHeight(); setupRenderer();/*from w w w. j av a 2 s . co m*/ setupWebGLCanvas(renderer); RootLayoutPanel.get().add(canvas); setupScene(); setupCamera(); rootGroup = THREE.Object3D(); scene.add(rootGroup); backgroundContainer = THREE.Object3D(); rootGroup.add(backgroundContainer); final Geometry geo = THREE.PlaneGeometry(100, 100, 20, 20); final Mesh mesh = THREE.Mesh(geo, THREE.MeshBasicMaterial().color(0x666666).wireFrame(true).build()); mesh.setRotation(Math.toRadians(-90), 0, 0); backgroundContainer.add(mesh); setupUpdater(); dialog = new PopupPanel(); setupDialogRoot(); createPlayer(main); dialog.show(); Util.rightTop(dialog); Window.addResizeHandler(new IndexResizeHandler(this)); HTMLPanel html = new HTMLPanel(getHtml()); html.setWidth("100%"); html.setHeight("20px"); html.setStyleName("text"); htmlDialog = new PopupPanel(); htmlDialog.add(html); htmlDialog.setPopupPosition(150, 30); htmlDialog.setWidth("100%"); htmlDialog.setStyleName("transparent"); htmlDialog.show(); }
From source file:edu.udes.bio.genus.client.GenUS.java
License:Open Source License
/** * This is the entry point method./*from w w w . j av a 2s . co m*/ */ public void onModuleLoad() { // Setup the browser window Window.enableScrolling(false); Window.setMargin("0px"); Window.setTitle("GenUS : Genetic profiling tool"); // Setup the root panel RootPanel.get().setSize("100%", "100%"); // Setup the background panel setSize("100%", "100%"); RootPanel.get().add(this); // Set display area this.add(GenUS.displayArea, 0, 0); // Add the zoomer final Scaler zoomer = new Scaler(GenUS.displayArea); this.add(zoomer, Window.getClientWidth() - 21, 0); // Add the main menu this.add(GenUS.mainMenu, 0, 0); // Add the properties panel this.add(GenUS.propMenu, Window.getClientWidth() - 502, Window.getClientHeight() - 125); // ### TESTING : Add a strand to pool // try { // // final RNAssDrawable testStrand = new RNAssDrawable("..((((((((......))))))))..", "ACGUGCCACGAUUCAACGUGGCACAG", GenUS.displayArea); // // testStrand.setName("TEST").scale(GenUS.displayArea.scaleFactor); // // // // GenUS.rnaPool.addToPool(testStrand); // // // // final RNAssDrawable testStrand2 = new RNAssDrawable(".(((....)..))..", "ACGUGCCACGAU", GenUS.displayArea); // // testStrand.setName("TEST2").scale(GenUS.displayArea.scaleFactor).setDrawStyle(DrawStyle.Linear_Round); // // // // GenUS.rnaPool.addToPool(testStrand2); // // /* // * for (int i = 0; i < 5; i++) { RNAssDrawable testStrand2 = new RNAssDrawable("..((......))", i + " ", displayArea); testStrand2.setName("TEST" + i).scale(displayArea.scaleFactor); testStrand2.setDrawStyle(RNAssDrawable.DrawStyle.Linear_Round); // * // * rnaPool.addToPool(testStrand2); } // */ // // } catch (final Exception e) { // Window.alert("TESTING STRAND ERROR GOTTA FIX TAHT SHIT: " + e.getMessage()); // } }
From source file:edu.ycp.cs.netcoder.client.CourseAndProblemView.java
License:Open Source License
private void doResize() { getLayoutPanel().setWidgetTopHeight(problemDescriptionWidget, LayoutConstants.TOP_BAR_HEIGHT_PX, Unit.PX, LayoutConstants.CP_PROBLEM_DESC_HEIGHT_PX, Unit.PX); int availHeight = Window.getClientHeight() - LayoutConstants.TOP_BAR_HEIGHT_PX - LayoutConstants.CP_STATUS_AND_BUTTON_BAR_HEIGHT_PX - LayoutConstants.CP_PROBLEM_DESC_HEIGHT_PX; if (courseTree != null) { getLayoutPanel().setWidgetLeftWidth(courseTree, 0, Unit.PX, LayoutConstants.CP_COURSE_TREE_WIDTH_PX, Unit.PX);/*from ww w.java2s.c o m*/ getLayoutPanel().setWidgetTopHeight(courseTree, LayoutConstants.TOP_BAR_HEIGHT_PX + LayoutConstants.CP_PROBLEM_DESC_HEIGHT_PX, Unit.PX, availHeight, Unit.PX); } getLayoutPanel().setWidgetRightWidth(table, 0, Unit.PX, Window.getClientWidth() - LayoutConstants.CP_COURSE_TREE_WIDTH_PX - 8, Unit.PX); getLayoutPanel().setWidgetTopHeight(table, LayoutConstants.TOP_BAR_HEIGHT_PX + LayoutConstants.CP_PROBLEM_DESC_HEIGHT_PX, Unit.PX, availHeight, Unit.PX); getLayoutPanel().setWidgetBottomHeight(statusAndButtonBar, 0, Unit.PX, LayoutConstants.CP_STATUS_AND_BUTTON_BAR_HEIGHT_PX, Unit.PX); }
From source file:edu.ycp.cs.netcoder.client.DevelopmentView.java
License:Open Source License
protected void doResize() { int height = Window.getClientHeight(); int availableForEditor = height - (LayoutConstants.TOP_BAR_HEIGHT_PX + LayoutConstants.DEV_PROBLEM_DESC_HEIGHT_PX + LayoutConstants.DEV_STATUS_AND_BUTTON_BAR_HEIGHT_PX + LayoutConstants.DEV_RESULTS_PANEL_HEIGHT_PX); if (availableForEditor < 0) { availableForEditor = 0;/*from w w w . j ava 2s . co m*/ } getLayoutPanel().setWidgetTopHeight(editor, LayoutConstants.TOP_BAR_HEIGHT_PX + LayoutConstants.DEV_PROBLEM_DESC_HEIGHT_PX, Unit.PX, availableForEditor, Unit.PX); getLayoutPanel().setWidgetBottomHeight(resultsTabPanel, 0, Unit.PX, LayoutConstants.DEV_RESULTS_PANEL_HEIGHT_PX, Unit.PX); }
From source file:es.deusto.weblab.client.experiments.controlapp.ui.ControlAppExperiment.java
License:Open Source License
@Override public void start(final int time, String initialConfiguration) { final JSONObject value = JSONParser.parseStrict(initialConfiguration).isObject(); final String baseURL = value.get("url").isString().stringValue(); System.out.println("Control app URL=" + baseURL); final String width = this.configurationRetriever.getProperty(EXTERNAL_WIDTH, "" + Window.getClientWidth()); final String height = this.configurationRetriever.getProperty(EXTERNAL_HEIGHT, "" + Window.getClientHeight()); final long startTime = System.currentTimeMillis(); switch (getLinkPresentation()) { case iframe:/*from ww w. j a v a2s.co m*/ final String iframeUrl = baseURL.replace("TIME_REMAINING", "" + time); final HTML html = new HTML("<iframe src='" + iframeUrl + "' width='" + width + "' height='" + height + "px' frameborder='0'/>"); putWidget(html); break; case popup: final VerticalPanel vp = new VerticalPanel(); final Button popupButton = new Button(i18n.remoteSystem()); popupButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { final long now = System.currentTimeMillis(); final long elapsed = now - startTime; final long nowTime = 1000 * time - elapsed; final String popupUrl = baseURL.replace("TIME_REMAINING", "" + (nowTime / 1000)); Window.open(popupUrl, "_blank", "resizable=yes,scrollbars=yes,dependent=yes,width=" + width + ",height=" + height + ",top=0"); } }); vp.add(popupButton); putWidget(vp); break; case redirection: String redirectionUrl = baseURL.replace("TIME_REMAINING", "" + time); this.boardController.disableFinishOnClose(); final Anchor anch = new Anchor(i18n.remoteSystem(), redirectionUrl); putWidget(anch); Location.replace(redirectionUrl); break; } }