List of usage examples for com.google.gwt.user.client Window getClientWidth
public static int getClientWidth()
From source file:cc.kune.common.client.ui.dialogs.BasicTopDialog.java
License:GNU Affero Public License
/** * Recalculate size. */ public void recalculateSize() { setSizes(Window.getClientWidth(), Window.getClientHeight()); }
From source file:cc.kune.common.client.ui.KuneWindowUtils.java
License:GNU Affero Public License
/** * Gets the client width./*from w ww. j a v a 2 s .c o m*/ * * @return the client width */ public static int getClientWidth() { return Window.getClientWidth(); }
From source file:cc.kune.common.client.ui.PopupBottomPanel.java
License:GNU Affero Public License
@Override protected void setCenterPositionImpl() { setPopupPositionAndShow(new PopupPanel.PositionCallback() { @Override/* w ww . j a v a 2 s. c o m*/ public void setPosition(final int offsetWidth, final int offsetHeight) { final Widget widget = getWidget(); final int x = (Window.getClientWidth() - (widget != null ? getWidget().getOffsetWidth() : 0)) / 2; final int y = Window.getClientHeight() - (widget != null ? getWidget().getOffsetHeight() : 0); PopupBottomPanel.this.setPopupPosition(x, y); } }); }
From source file:cc.kune.common.client.ui.PopupTopPanel.java
License:GNU Affero Public License
@Override protected void setCenterPositionImpl() { setPopupPositionAndShow(new PopupPanel.PositionCallback() { @Override//from w w w . java 2s . c om public void setPosition(final int offsetWidth, final int offsetHeight) { final int x = (Window.getClientWidth() - (getWidget() != null ? getWidget().getOffsetWidth() : 0)) / 2; final int y = 0; PopupTopPanel.this.setPopupPosition(x, y); } }); }
From source file:cc.kune.core.client.sub.SubtitlesWidget.java
License:GNU Affero Public License
@Override public void show(final SimpleCallback callback) { this.callback = callback; popup.setWidget(widget);//from ww w. j a v a 2s . c om setSize(Window.getClientWidth(), Window.getClientHeight()); popup.sinkEvents(Event.MOUSEEVENTS); popup.show(); final Show showAtIni = new Show(widget.getElement()); showAtIni.setDuration(2); showAtIni.play(); final SlideRight slideAtIni = new SlideRight(widget.getElement()); slideAtIni.setDuration(2); slideAtIni.play(); this.showing = true; }
From source file:cc.kune.embed.client.panels.EmbedSitebar.java
License:GNU Affero Public License
private void centerAndShow() { // This is needed because the panel has different sizes depending on // the session Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override//from w w w . j a v a 2 s . com public void execute() { // We do this in deferred so we have the correct size of screen & // toolbar popup.setPopupPositionAndShow(new PopupPanel.PositionCallback() { @Override public void setPosition(final int offsetWidth, final int offsetHeight) { final Integer rightMargin = EmbedConfiguration.get().getSitebarRightMargin(); final int left = Window.getClientWidth() - toolbar.getOffsetWidth() - rightMargin; final int top = EmbedConfiguration.get().getSitebarTopMargin(); popup.setPopupPosition(left, top); } }); } }); }
From source file:cc.kune.gspace.client.feedback.FeedbackBottomPanel.java
License:GNU Affero Public License
@Override protected void setCenterPositionImpl() { setPopupPositionAndShow(new PopupPanel.PositionCallback() { @Override//from w w w . j av a 2 s . co m public void setPosition(final int offsetWidth, final int offsetHeight) { final int x = Window.getClientWidth() - offsetWidth - 76; final int y = Window.getClientHeight() - offsetHeight + 1; FeedbackBottomPanel.this.setPopupPosition(x, y); } }); }
From source file:cc.kune.sandbox.client.KuneSandboxEntryPoint.java
License:GNU Affero Public License
/** * Test tooltips./*w w w .ja v a2 s . c o 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. ja va2s . 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.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 ww . j a v a 2 s.com*/ }