List of usage examples for com.google.gwt.user.client Window getClientHeight
public static int getClientHeight()
From source file:com.audata.client.admin.UserDialog.java
License:Open Source License
public UserDialog(UserPanel parent, String uuid, HashMap details) { this.parent = parent; this.uuid = uuid; if (this.uuid != "") { this.setText(LANG.edit_user_Text()); //call details } else {/*from w w w .j av a 2s.c om*/ this.setText(LANG.new_user_Text()); } //build empty VerticalPanel main = new VerticalPanel(); HorizontalPanel fname = new HorizontalPanel(); fname.setSpacing(5); Label flabel = new Label(LANG.forename_Text()); flabel.setWidth("150px"); fname.add(flabel); this.forename = new TextBox(); fname.add(this.forename); main.add(fname); HorizontalPanel sname = new HorizontalPanel(); sname.setSpacing(5); Label slabel = new Label(LANG.surname_Text()); slabel.setWidth("150px"); sname.add(slabel); this.surname = new TextBox(); sname.add(this.surname); main.add(sname); HorizontalPanel uname = new HorizontalPanel(); uname.setSpacing(5); Label ulabel = new Label(LANG.username_Text()); ulabel.setWidth("150px"); uname.add(ulabel); this.username = new TextBox(); uname.add(this.username); main.add(uname); if (this.uuid.equals("")) { HorizontalPanel p1 = new HorizontalPanel(); p1.setSpacing(5); Label p1label = new Label(LANG.password_Text()); p1label.setWidth("150px"); p1.add(p1label); this.pass1 = new PasswordTextBox(); p1.add(this.pass1); main.add(p1); HorizontalPanel p2 = new HorizontalPanel(); p2.setSpacing(5); Label p2label = new Label(LANG.password_reenter_Text()); p2label.setWidth("150px"); p2.add(p2label); this.pass2 = new PasswordTextBox(); p2.add(this.pass2); main.add(p2); } HorizontalPanel adminPanel = new HorizontalPanel(); adminPanel.setSpacing(5); Label adminlabel = new Label(LANG.is_admin_Text()); adminlabel.setWidth("150px"); adminPanel.add(adminlabel); this.isAdmin = new CheckBox(); adminPanel.add(this.isAdmin); main.add(adminPanel); HorizontalPanel levPanel = new HorizontalPanel(); levPanel.setSpacing(5); Label levlabel = new Label(LANG.security_level_Text()); levlabel.setWidth("150px"); levPanel.add(levlabel); this.secLevel = new ListBox(); levPanel.add(this.secLevel); main.add(levPanel); HorizontalPanel cavPanel = new HorizontalPanel(); cavPanel.setSpacing(5); Label cavlabel = new Label(LANG.security_caveats_Text()); cavlabel.setWidth("150px"); cavPanel.add(cavlabel); this.caveats = new ListBox(); this.caveats.setMultipleSelect(true); this.caveats.setVisibleItemCount(5); cavPanel.add(this.caveats); main.add(cavPanel); HorizontalPanel butPanel = new HorizontalPanel(); butPanel.setSpacing(5); this.saveBut = new Button(LANG.save_Text()); this.saveBut.addClickListener(this); butPanel.add(this.saveBut); this.cancelBut = new Button(LANG.cancel_Text()); this.cancelBut.addClickListener(this); butPanel.add(this.cancelBut); main.add(butPanel); this.popLists(); this.setWidget(main); //this.show(); int left = (Window.getClientWidth() - this.getOffsetWidth()) / 2; int top = (Window.getClientHeight() - this.getOffsetHeight()) / 2; this.setPopupPosition(left, top); if (details != null) { this.setValues(details); } }
From source file:com.audata.client.admin.UserPanel.java
License:Open Source License
public void onClick(Widget sender) { if (sender == this.setPassword) { if (this.userUUID != "") { this.dialog.show(this.userUUID); this.dialog.setVisible(false); int left = (Window.getClientWidth() / 2) - 150; int top = (Window.getClientHeight() / 2) - 50; this.dialog.setPopupPosition(left, top); Effect.appear(this.dialog); }//from w w w. j a v a 2 s . c o m return; } if (sender == this.newUser) { UserDialog dialog = new UserDialog(this); //dialog.setVisible(false); dialog.show(); int left = (Window.getClientWidth() / 2) - 150; int top = (Window.getClientHeight() / 2) - 150; dialog.setPopupPosition(left, top); Effect.appear(dialog); return; } if (sender == this.editUser) { if (this.userUUID != "") { UserDialog dialog = new UserDialog(this, this.userUUID, this.custom); //dialog.setVisible(false); dialog.show(); int left = (Window.getClientWidth() / 2) - 150; int top = (Window.getClientHeight() / 2) - 150; dialog.setPopupPosition(left, top); Effect.appear(dialog); } return; } if (sender == this.delUser) { if (this.userUUID != "") { SimpleDialog.displayDialog(SimpleDialog.TYPE_QUERY, LANG.confirm_Text(), LANG.del_user_msg_Text(), this); } } }
From source file:com.audata.client.authentication.LoginDialog.java
License:Open Source License
/** * Overide parent show to integrate effects *//*from w ww . j a v a 2s . com*/ public void show() { this.setPopupPosition(-400, -400); super.show(); //this.setVisible(false); Effect.appear(this); int left = (Window.getClientWidth() / 2) - 150; int top = (Window.getClientHeight() / 2) - 50; this.setPopupPosition(left, top); }
From source file:com.audata.client.checkout.CheckinDialog.java
License:Open Source License
/** * Overide parent show to integrate effects *///from w w w . j av a 2 s .c om public void show() { this.setVisible(false); super.show(); Effect.appear(this); int left = (Window.getClientWidth() / 2) - 150; int top = (Window.getClientHeight() / 2) - 150; this.setPopupPosition(left, top); }
From source file:com.axlight.gbrain.client.MainPane.java
License:Apache License
private static int getWindowScreenHeight() { if (GBrain.isIPhone) { return getWindowInnerHeight(); } else {/*from w w w .j av a2 s. c o m*/ return Window.getClientHeight(); } }
From source file:com.canoo.gwt.contentflow4gwt.client.ContentFlowDemo.java
License:Open Source License
private ContentFlowPopupPanel<Person> doAnimateContentFlowIn() { int horizontalMargin = (Window.getClientWidth() - POPUP_WIDTH) / 2; int verticalMargin = (Window.getClientHeight() - POPUP_HEIGHT) / 2; final int initialLeft = Window.getClientWidth() + horizontalMargin; ContentFlow<Person> contentFlow = new ContentFlow<Person>(true, true); addItems(contentFlow, PEOPLE.length); final ContentFlowPopupPanel<Person> popupPanel = new ContentFlowPopupPanel<Person>(contentFlow); popupPanel.setSize(POPUP_WIDTH + "px", POPUP_HEIGHT + "px"); popupPanel.setPopupPosition(initialLeft, verticalMargin); contentFlow.addItemClickListener(new ContentFlowItemClickListener() { public void onItemClicked(Widget widget) { Window.alert("Clicked: "); }/*from w w w .j a va 2s . c o m*/ }); popupPanel.show(); animatePopupPanel(popupPanel, initialLeft, horizontalMargin, ANIMATION_DURATION); return popupPanel; }
From source file:com.centretown.planets.client.application.widget.SizeableView.java
License:Apache License
public SizeableView() { Window.addResizeHandler(this); sizeWidth = Window.getClientWidth(); sizeHeight = Window.getClientHeight(); sanityCheck = 0; }
From source file:com.centretown.planets.client.application.widget.SizeableView.java
License:Apache License
protected void doResize() { int top = element.getAbsoluteTop(); if (top > 0) { sizeWidth = Window.getClientWidth(); sizeHeight = Window.getClientHeight() - top; element.getStyle().setWidth(sizeWidth, Unit.PX); element.getStyle().setHeight(sizeHeight, Unit.PX); sanityCheck = 0;/*w w w . j a v a2 s. c om*/ } else { initialize(element); } }
From source file:com.chinarewards.gwt.license.client.core.ui.impl.SimpleSiteManager.java
@Override public void openDialog(final Dialog dialog, final DialogCloseListener handler) { // If the instanceId existing, return. if (openedDialogs.containsKey(dialog.getInstanceId())) { return;//from w ww . ja va2 s. c o m } openedDialogs.put(dialog.getInstanceId(), dialog); openedDialogHandlers.put(dialog.getInstanceId(), handler); DialogBox dialogBox = new DialogBox(); ScrollPanel panel = new ScrollPanel(); panel.add(dialog.asWidget()); dialogBox.setWidget(panel); dialogBox.setGlassEnabled(true); dialogBox.setAnimationEnabled(true); dialogBox.setText(dialog.getTitle()); dialogBox.setDialog(dialog); // FIXME yanxin 20111130 dialogBox.setDialog(dialog); dialogBox.center(); dialogBox.setPopupPosition(Window.getClientWidth() / 4, Window.getClientHeight() / 4); dialogBox.show(); // Set max height for scroll panel. Deduction 30 PX for dialog title. // The window client should great than 30px, or it will not open dialog. int height = dialog.asWidget().getOffsetHeight(); if (height > Window.getClientHeight()) { panel.setHeight(Window.getClientHeight() - 30 + "px"); } openedDialogBoxes.put(dialog.getInstanceId(), dialogBox); }
From source file:com.claudiushauptmann.gwt.maps.gxt.client.MarkerGXTController.java
License:Apache License
/** * Updates the tip position. This method is called by its base class when * the mouse moves and the tip position has to be updated. *//*from w ww. ja v a 2 s . c om*/ @Override protected void updateTipPosition() { if (currentTip != null) { int x = mapMenuController.getCurrentMousePosition().getX() + 20; int y = mapMenuController.getCurrentMousePosition().getY() + 20; int width = currentTip.getWidth(); int height = currentTip.getHeight(); if ((x + width) > Window.getClientWidth() + Window.getScrollLeft() - 10) { x = mapMenuController.getCurrentMousePosition().getX() - 20 - width; } if ((y + height) > Window.getClientHeight() + Window.getScrollTop() - 10) { y = mapMenuController.getCurrentMousePosition().getY() - 20 - height; } currentTip.setPosition(x, y); } }