List of usage examples for com.google.gwt.user.client Window getClientHeight
public static int getClientHeight()
From source file:com.extjs.gxt.ui.client.widget.Popup.java
License:sencha.com license
protected Popup onShowPopup() { RootPanel.get().add(this); hidden = false;/*from ww w. jav a2s. c om*/ Point p = null; if (alignElem != null) { alignPos = alignPos != null ? alignPos : getDefaultAlign(); alignOffsets = alignOffsets != null ? alignOffsets : new int[] { 0, 2 }; p = el().getAlignToXY(alignElem, alignPos, alignOffsets); } else if (alignPoint != null) { p = alignPoint; } el().makePositionable(true).setVisibility(false); el().setLeftTop(p.x, p.y); alignElem = null; alignPos = null; alignOffsets = null; alignPoint = null; if (constrainViewport) { int clientHeight = Window.getClientHeight() + XDOM.getBodyScrollTop(); int clientWidth = Window.getClientWidth() + XDOM.getBodyScrollLeft(); Rectangle r = el().getBounds(); int x = r.x; int y = r.y; if (y + r.height > clientHeight) { y = clientHeight - r.height - getYOffset(); el().setTop(y); } if (x + r.width > clientWidth) { x = clientWidth - r.width - getXOffset(); el().setLeft(x); } } el().setVisibility(true); if (autoHide) { preview.add(); } if (animate) { el().fadeIn(new FxConfig(new Listener<FxEvent>() { public void handleEvent(FxEvent fe) { afterShow(); } })); } else { afterShow(); } return this; }
From source file:com.extjs.gxt.ui.client.widget.Shim.java
License:sencha.com license
/** * Creates and covers the area with a Shim. If shimIframes is true will only * covers IFrames.//from ww w .jav a 2s . c o m * * @param shimIframes true if you want to cover only Iframes */ public void cover(boolean shimIframes) { if (shimIframes) { NodeList<Element> elements = XDOM.getBodyEl().select("iframe:not(.x-noshim)"); shim(elements); elements = XDOM.getBodyEl().select("object:not(.x-noshim)"); shim(elements); elements = XDOM.getBodyEl().select("applet:not(.x-noshim)"); shim(elements); elements = XDOM.getBodyEl().select("embed:not(.x-noshim)"); shim(elements); } else { shims.add(createShim(null, 0, 0, Window.getClientWidth(), Window.getClientHeight())); } }
From source file:com.extjs.gxt.ui.client.widget.Viewport.java
License:sencha.com license
public void onAttach() { setEnableScroll(enableScroll);/*ww w .j av a 2 s . co m*/ setSize(Window.getClientWidth(), Window.getClientHeight()); super.onAttach(); GXT.hideLoadingPanel(loadingPanelId); }
From source file:com.facebook.tsdb.tsdash.client.presenter.GraphPresenter.java
License:Apache License
private int estimateHeight(ApplicationState appState) { // header + auto relaad int topHeight = appState.fullscreen ? 50 : 50 + 50 + 10; return Window.getClientHeight() - topHeight; }
From source file:com.flatown.client.BookmarksPanel.java
License:Apache License
private BookmarksPanel() { _bookmarks = new BookmarkResultsBox(); _savedIds = new String[MaxBookmarks]; _count = 0;/*from w w w . j av a 2 s .c om*/ VerticalPanel displayPanel = new VerticalPanel(); displayPanel.add(createControls()); displayPanel.add(_bookmarks); setWidget(displayPanel); DOM.setStyleAttribute(displayPanel.getElement(), "width", "100%"); DOM.setStyleAttribute(getElement(), "width", "100%"); DOM.setStyleAttribute(getElement(), "height", "100%"); DOM.setStyleAttribute(getElement(), "backgroundColor", "#E5ECF9"); DOM.setStyleAttribute(getElement(), "maxHeight", Window.getClientHeight() - 50 + "px"); }
From source file:com.flatown.client.FavoritesPanel.java
License:Apache License
private FavoritesPanel() { _favorites = new VerticalPanel(); _favorites.setStyleName("favorites"); _listenerPanel = new FocusPanel(_favorites); _listenerPanel.addMouseListener(new MouseListenerAdapter() { public void onMouseLeave(Widget sender) { _clicked = null;// ww w . java 2 s.co m } public void onMouseUp(Widget sender, int x, int y) { _clicked = null; } }); setWidget(_listenerPanel); setStyleName("favoritesPanel"); DOM.setStyleAttribute(getElement(), "maxHeight", Window.getClientHeight() - 50 + "px"); _dragListener = new MouseListenerAdapter() { public void onMouseEnter(Widget sender) { if (sender instanceof DragBar) { DragBar bar = (DragBar) sender; if (isClicked() && _clicked != bar) { int newPos = _favorites.getWidgetIndex(bar.getDragWidget()); _favorites.remove(_clicked.getDragWidget()); _favorites.insert(_clicked.getDragWidget(), newPos); } } } public void onMouseDown(Widget sender, int x, int y) { if (sender instanceof DragBar) _clicked = (DragBar) sender; } public void onMouseUp(Widget sender, int x, int y) { if (isClicked()) GBox.Prefs.saveFavorites(); } }; }
From source file:com.flatown.client.HelpPanel.java
License:Apache License
private HelpPanel() { _controlPanel = new StackPanel(); _controlPanel.add(makeSearchHelp(), makeHeader("Searching PubMed"), true); _controlPanel.add(makeSaveFavHelp(), makeHeader("Saving Favorites"), true); _controlPanel.add(makeSaveBookmarkHelp(), makeHeader("Saving Bookmarks"), true); _controlPanel.add(makeExportHelp(), makeHeader("Exporting Results"), true); _controlPanel.add(makeShareLinkHelp(), makeHeader("Sharing Gadget Links"), true); // go to search to begin: search from there and add searches to favorites // if you save favorites it will load automatically instead of the help panel // you can save multiple favorites and reorder them by dragging and dropping // you can change the number of results or use the checkbox // click on results -> open the pubmed page // save as a bookmark // tag it for export // perform export from sharepanel setWidget(_controlPanel);//from www .j a v a 2 s . com DOM.setStyleAttribute(getElement(), "width", "100%"); DOM.setStyleAttribute(getElement(), "height", "100%"); DOM.setStyleAttribute(getElement(), "backgroundColor", "#E5ECF9"); DOM.setStyleAttribute(getElement(), "maxHeight", Window.getClientHeight() - 40 + "px"); DOM.setStyleAttribute(_controlPanel.getElement(), "width", "100%"); DOM.setStyleAttribute(_controlPanel.getElement(), "height", "100%"); }
From source file:com.flatown.client.SearchPanel.java
License:Apache License
private SearchPanel() { VerticalPanel displayPanel = new VerticalPanel(); displayPanel.add(new SearchBox()); setWidget(displayPanel);/*w w w . j a v a 2 s . co m*/ DOM.setStyleAttribute(displayPanel.getElement(), "width", "100%"); DOM.setStyleAttribute(displayPanel.getElement(), "height", "100%"); DOM.setStyleAttribute(getElement(), "maxHeight", Window.getClientHeight() - 40 + "px"); }
From source file:com.flatown.client.SharePanel.java
License:Apache License
private SharePanel() { _controlPanel = new StackPanel(); _controlPanel.add(LinkAndCodePanel.Singleton, makeHeader("Link to Gadget"), true); _controlPanel.add(ExportPanel.Singleton, makeHeader("Export"), true); _controlPanel.add(ImportPanel.Singleton, makeHeader("Import"), true); setWidget(_controlPanel);/* w w w . jav a 2 s . c o m*/ DOM.setStyleAttribute(getElement(), "width", "100%"); DOM.setStyleAttribute(getElement(), "height", "100%"); DOM.setStyleAttribute(getElement(), "backgroundColor", "#E5ECF9"); DOM.setStyleAttribute(getElement(), "maxHeight", Window.getClientHeight() - 50 + "px"); DOM.setStyleAttribute(_controlPanel.getElement(), "width", "100%"); DOM.setStyleAttribute(_controlPanel.getElement(), "height", "100%"); }
From source file:com.google.appinventor.client.editor.youngandroid.YaBlocksEditor.java
License:Open Source License
YaBlocksEditor(YaProjectEditor projectEditor, YoungAndroidBlocksNode blocksNode) { super(projectEditor, blocksNode); this.blocksNode = blocksNode; COMPONENT_DATABASE = SimpleComponentDatabase.getInstance(getProjectId()); fullFormName = blocksNode.getProjectId() + "_" + blocksNode.getFormName(); formToBlocksEditor.put(fullFormName, this); blocksArea = new BlocklyPanel(this, fullFormName); // [lyn, 2014/10/28] pass in editor so can extract form json from it blocksArea.setWidth("100%"); // This code seems to be using a rather old layout, so we cannot simply pass 100% for height. // Instead, it needs to be calculated from the client's window, and a listener added to Window // We use VIEWER_WINDOW_OFFSET as an approximation of the size of the top navigation bar // New layouts don't need all this messing; see comments on selected answer at: // http://stackoverflow.com/questions/86901/creating-a-fluid-panel-in-gwt-to-fill-the-page blocksArea.setHeight(Window.getClientHeight() - VIEWER_WINDOW_OFFSET + "px"); Window.addResizeHandler(new ResizeHandler() { public void onResize(ResizeEvent event) { int height = event.getHeight(); blocksArea.setHeight(height - VIEWER_WINDOW_OFFSET + "px"); }//from www . j a v a 2 s . c om }); initWidget(blocksArea); addComponentDatabaseChangeListener(blocksArea); // Get references to the source structure explorer sourceStructureExplorer = BlockSelectorBox.getBlockSelectorBox().getSourceStructureExplorer(); // Listen for selection events for built-in drawers BlockSelectorBox.getBlockSelectorBox().addBlockDrawerSelectionListener(this); // Create palettePanel, which will be used as the content of the PaletteBox. myFormEditor = projectEditor.getFormFileEditor(blocksNode.getFormName()); if (myFormEditor != null) { palettePanel = new YoungAndroidPalettePanel(myFormEditor); palettePanel.loadComponents(new DropTargetProvider() { // TODO(sharon): make the tree in the BlockSelectorBox a drop target @Override public DropTarget[] getDropTargets() { return new DropTarget[0]; } }); palettePanel.setSize("100%", "100%"); } else { palettePanel = null; OdeLog.wlog("Can't get form editor for blocks: " + getFileId()); } }