List of usage examples for com.google.gwt.user.client Window getClientWidth
public static int getClientWidth()
From source file:com.dimdim.conference.ui.layout2.client.MainLayout.java
License:Open Source License
public void onModuleLoad() { // this.originalWidth = Window.getClientWidth(); // this.minimumWidth = this.originalWidth; // if (this.minimumWidth > 1024) // {//from w w w.j a va2s . c o m // this.minimumWidth = 1024; // } // this.originalHeight = Window.getClientHeight(); // this.minimumHeight = this.originalHeight; // if (this.minimumHeight > 768) // { // this.minimumHeight = 768; // } ConferenceGlobals.setContentWidth(Window.getClientWidth()); ConferenceGlobals.setContentHeight(Window.getClientHeight()); ConferenceGlobals.conferenceKey = getConfKey(); // lmm = new LoadingModuleMessage("Loading....."); //RootPanel.get("MainConsole").add(lmm); // lmm.setSize(Window.getClientWidth()+"px",Window.getClientHeight()+"px"); UIDataDictionaryManager.initManager(getWebAppName(), getConfKey(), getUserType(), // new String[]{"dictionary","dictionary","dictionary","dictionary","dictionary"}, // new String[]{"console","console","console","global_string","session_string"}, // new String[]{"ui_strings","tooltips","default_layout","emoticons","user_info"+getDataCacheId()}); new String[] { "combined" }, new String[] { "session_string" }, new String[] { "user_info" + getDataCacheId() }); UIDataDictionaryManager.getManager().readDataDictionaries(this); }
From source file:com.dimdim.conference.ui.layout2.client.MainLayout.java
License:Open Source License
protected void loadConsole() { DebugPanel.getDebugPanel().addDebugMessage("Initializing Console"); // Now once the environment i initialized the client model can be // created which depends on it. // String getEventsURL = ConferenceGlobals.webappRoot+ // "GetEvents.action?sessionKey="+ConferenceGlobals.sessionKey; String getEventsURL = ConferenceGlobals.webappRoot + "GetEvents.action?sessionKey=" + ConferenceGlobals.sessionKey; String serverPingURL = ConferenceGlobals.webappRoot + "PingServer.action"; ClientModel.createClientModel();// w w w .ja va2 s . c om DebugPanel.getDebugPanel().addDebugMessage("Client model creation complete"); Window.setMargin("0px"); try { UIRosterEntry currentUser = ClientModel.getClientModel().getRosterModel().getCurrentUser(); fullPanel = new ConsoleFullPanel(this, currentUser); //RootPanel.get("MainConsole").remove(this.lmm); //RootPanel.get("MainConsole").add(fullPanel); //RootPanel.get("MainConsole").add(fullPanel.getTopPanel()) //this.meetingAssistent = new MeetingAssistentDialog(this.workspaceClickListener); } catch (Exception e) { Window.alert(e.getMessage()); } DebugPanel.getDebugPanel().addDebugMessage("Fetching initial data"); ClientModel.getClientModel().getClientStateModel().addListener(this.fullPanel.getMiddlePanel()); ClientModel.getClientModel().getRosterModel() .addListener(this.fullPanel.getMiddlePanel().getRosterModelListener()); UIParams uiParams = UIParams.getUIParams(); EventsJsonHandler eventsHandler = EventsJsonHandler.getHandler(); eventsHandler.setEventsTracker(DebugPanel.getDebugPanel()); gerth = new GetEventResponseTextHandler(eventsHandler, uiParams.getRegularEventPollIntervalMillis(), uiParams.getMaxEventPollErrors()); gerth.setServerPingURL(serverPingURL); eventsReadingTimer = new JSONurlReadingTimer(getEventsURL, getConfKey(), uiParams.getInitialEventPollDelayMillis(), gerth); gerth.setServerStatusListener(this.eventsReadingTimer); eventsReadingTimer.start(); resizeListener = new ResizeListener(); Window.addWindowResizeListener(resizeListener); DeferredCommand.addCommand(new Command() { public void execute() { resizeListener.onWindowResized(Window.getClientWidth(), Window.getClientHeight()); continueLoading(); } }); ClientModel.getClientModel().getRosterModel().reportConsoleLoaded(); // ConsoleDataReader dataReader = new ConsoleDataReader(this); // dataReader.readConsoleData(); DebugPanel.getDebugPanel().addDebugMessage("Console initialization complete."); JSInterface.addCallbackListener(CopyFlashListener.getListener()); // showConsole(); // linking meeting assistant dialog listener // meetingAssistent = new MeetingAssistentDialog(fullPanel.getMiddlePanel().getLeftPanel()); // fullPanel.getTopPanel().getToolsPanel().getAssistantLabel().addClickListener(this); }
From source file:com.dimdim.conference.ui.popout.client.PopoutWindow.java
License:Open Source License
/** * // www .ja v a 2 s .c o m * */ public PopoutWindow(final String windowId, String panelId, PopoutWindowContent popoutWindowContent) { this.windowId = windowId; this.panelId = panelId; this.popoutWindowContent = popoutWindowContent; ClientModel.createClientModel(); // Window.alert("1"); Window.addWindowCloseListener(this); resizeListener = new PopoutResizeListener(); Window.addWindowResizeListener(resizeListener); popoutWindowContent.preparePopoutWindowContent(); // Window.alert("2"); this.eventsTextHandler = new PopoutPageEventTextHandler(EventsJsonHandler.getHandler()); // Window.alert("3"); this.dataTextHandler = new PopoutPageDataTextHandler(windowId, popoutWindowContent, this.eventsTextHandler); // Window.alert("4"); this.dataReader = new PopoutPageDataReader(100, this.dataTextHandler); // Window.alert("5"); // this.dataReader.start(); // Window.alert("6"); this.eventsReader = new PopoutPageEventsReader(1000, this.eventsTextHandler); // Window.alert("7"); // this.eventsReader.start(); // Window.alert("8"); // Window.alert("9"); DeferredCommand.add(new Command() { public void execute() { resizeListener.onWindowResized(Window.getClientWidth(), Window.getClientHeight()); String popoutLoadedMessage = "{objClass:\"PopoutPanelData\",windowId:\"" + windowId + "\",panelId:\"" + windowId + "\",dataText:\"POPOUT_LOADED\"}"; reportPopoutLoadedToConsole(popoutLoadedMessage); } }); // Window.alert("10"); }
From source file:com.dimdim.conference.ui.user.client.ActivePresenterAVWindow.java
License:Open Source License
public void setPositionToCenter() { int h = LayoutGlobals.getAVPlayerFloatPanelHeight(sizeFactor); int left = (Window.getClientWidth() / 2) - (h / 2); int top = (Window.getClientHeight() / 2) - (h / 2); if (top < 0) { top = 0;//from ww w .j a v a 2 s . c o m } else { if (top < 101) { top = 101; } } this.setPopupPosition(left, top); }
From source file:com.dimdim.conference.ui.user.client.AttendeeAudioBroadcasterFloat.java
License:Open Source License
public void setPositionToCenter() { int h = this.movieHeight;//LayoutGlobals.getAudioBroadcasterFloatPanelHeight(); int left = (Window.getClientWidth() / 2) - (h / 2); int top = (Window.getClientHeight() / 2) - (h / 2); this.setPopupPosition(left, top); }
From source file:com.dimdim.conference.ui.workspacepopout.client.WorkspacePopout.java
License:Open Source License
public void onModuleLoad() { ConferenceGlobals.setContentWidth(Window.getClientWidth()); ConferenceGlobals.setContentHeight(Window.getClientHeight()); ConferenceGlobals.conferenceKey = getConfKey(); UIDataDictionaryManager.initManager(getWebAppName(), getConfKey(), getUserType(), // new String[]{"dictionary","dictionary","dictionary","dictionary","dictionary"}, // new String[]{"console","console","console","global_string","session_string"}, // new String[]{"ui_strings","tooltips","default_layout","emoticons","user_info"+getDataCacheId()}); new String[] { "combined" }, new String[] { "session_string" }, new String[] { "user_info" + getDataCacheId() }); UIDataDictionaryManager.getManager().readDataDictionaries(this); }
From source file:com.edgenius.wiki.gwt.client.widgets.DialogBox.java
License:Open Source License
public DialogBox(UIObject parent, boolean autoHide, boolean withBackground, boolean modal) { super(autoHide, modal); if (modal && withBackground) lightbox = new Lightbox(parent, this); closeBtn.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { hidebox();//w ww. j av a 2 s . c o m } }); VerticalPanel panel = new VerticalPanel(); //caption part: caption focus panel(drag/drop handler) and close button captionTable.setWidget(0, 0, icon); captionTable.setWidget(0, 1, caption); captionTable.setWidget(0, 2, closeBtn); captionTable.getCellFormatter().setWidth(0, 0, "42px"); captionTable.getCellFormatter().setWidth(0, 2, "42px"); captionTable.getFlexCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_BOTTOM); captionTable.getFlexCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_RIGHT); captionTable.getFlexCellFormatter().setVerticalAlignment(0, 2, HasVerticalAlignment.ALIGN_BOTTOM); captionTable.getFlexCellFormatter().setStyleName(0, 0, "dlg-top-left"); captionTable.getFlexCellFormatter().setStyleName(0, 1, "dlg-border-top"); captionTable.getFlexCellFormatter().setStyleName(0, 2, "dlg-top-right"); captionTable.setCellPadding(0); captionTable.setCellSpacing(0); FlexTable bodyTable = new FlexTable(); bodyTable.getFlexCellFormatter().setStyleName(0, 0, "dlg-border-left"); bodyTable.getFlexCellFormatter().setStyleName(0, 2, "dlg-border-right"); bodyTable.setWidget(0, 1, body); bodyTable.setWidget(1, 0, buttonBar); bodyTable.setCellPadding(0); bodyTable.setCellSpacing(0); bodyTable.getFlexCellFormatter().setVerticalAlignment(0, 1, HasVerticalAlignment.ALIGN_TOP); bodyTable.getFlexCellFormatter().setVerticalAlignment(1, 1, HasVerticalAlignment.ALIGN_BOTTOM); bodyTable.getFlexCellFormatter().setStyleName(0, 1, Css.MAIN_BODY); bodyTable.getFlexCellFormatter().setStyleName(1, 0, Css.BUTTONS_BAR); bodyTable.getFlexCellFormatter().setRowSpan(0, 0, 2); bodyTable.getFlexCellFormatter().setRowSpan(0, 2, 2); bodyTable.getCellFormatter().setWidth(0, 0, "17px"); bodyTable.getCellFormatter().setWidth(0, 2, "17px"); FlexTable bottomTable = new FlexTable(); bottomTable.setWidget(0, 0, new HTML(" ")); //just a placeholder bottomTable.setWidget(0, 1, new HTML(" ")); //just a placeholder bottomTable.setWidget(0, 2, new HTML(" ")); //just a placeholder bottomTable.getFlexCellFormatter().setStyleName(0, 0, "dlg-bottom-left"); bottomTable.getFlexCellFormatter().setStyleName(0, 1, "dlg-border-bottom"); bottomTable.getFlexCellFormatter().setStyleName(0, 2, "dlg-bottom-right"); bottomTable.getCellFormatter().setWidth(1, 0, "34px"); bottomTable.getCellFormatter().setWidth(1, 2, "34px"); bottomTable.setCellPadding(0); bottomTable.setCellSpacing(0); panel.add(captionTable); panel.add(bodyTable); panel.add(bottomTable); //style captionTable.setWidth("100%"); bodyTable.setWidth("100%"); bottomTable.setWidth("100%"); body.setSize("100%", "100%"); caption.setWidth("100%"); panel.setStyleName(Css.DIALOG_BOX_TABLE); panel.setBorderWidth(0); caption.addMouseOutHandler(this); caption.addMouseOverHandler(this); caption.addMouseDownHandler(this); caption.addMouseUpHandler(this); caption.addMouseMoveHandler(this); // icon.addMouseOutHandler(this); // icon.addMouseOverHandler(this); // icon.addMouseDownHandler(this); // icon.addMouseUpHandler(this); // icon.addMouseMoveHandler(this); captionTable.setStyleName(Css.CAPTION); setStyleName(Css.DIALOG_BOX); windowWidth = Window.getClientWidth(); clientLeft = Document.get().getBodyOffsetLeft(); clientTop = Document.get().getBodyOffsetTop(); super.setWidget(panel); }
From source file:com.emitrom.flash4j.starling.client.core.runtime.StarlingPlatform.java
License:Apache License
public static Widget initAsWidget(StartHandler handler) { StarlingLoader loader = StarlingLoaderFactory.getLoader(); return loader.load(Window.getClientWidth(), Window.getClientHeight(), handler); }
From source file:com.emitrom.flash4j.swf.client.loader.SwfWidgetLoader.java
License:Apache License
/** * Initialize the SwfWidgetLoader framework as a widget filling the entire * browser window. This method should be use when trying to embed the * SwfWidgetLoader application into an existing GWT container. * //from w w w. ja va2s . c o m * @param handler * ,the handler to be called once the SwfWidgetLoader framework * was successfully loaded * @return, the SwfWidgetLoader widget to be added */ public static Widget initAsWidget(String path, StartHandler handler) { SwfLoader loader = SwfLoaderFactory.getLoader(path); return loader.load(Window.getClientWidth(), Window.getClientHeight(), handler); }
From source file:com.emitrom.flash4j.swf.client.loader.SwfWidgetLoader.java
License:Apache License
public static Widget initAsWidget(String path, String bridgeName, boolean transparent, StartHandler handler) { SwfLoader loader = SwfLoaderFactory.getLoader(path); return loader.load(Window.getClientWidth(), Window.getClientHeight(), bridgeName, transparent, handler); }