@PostConstruct public void buildUI() { OpenLayers.setProxyHost("gwtOpenLayersProxy?targetURL="); RootLayoutPanel.get().add(geoMap.getMapWidget()); RootPanel.get().add(actionBar); RootPanel.get().add(linksWidget); RootPanel.get().add(zoomStatusWidget); logger.info("Map initialize..."); geoMapInitializer.initialize(); rasterLayerInitializer.initialize(); vectorLayerInitializer.initialize(); widgetInitializer.initialize(); eventListenerInitializer.initialize(); showDisclaimer(); RestClient.setJacksonMarshallingActive(true); RootPanel.get("splash").setVisible(false); }
/** * SetWidgetsSize */ private void setWidgetsSize() { // Calculating real height usableHeight = Window.getClientHeight(); if (Main.get().hasHeaderCustomization) { usableHeight -= 72; RootLayoutPanel.get().setWidgetTopBottom(Main.get().mainPanel, 72, Style.Unit.PX, 0, Style.Unit.PX); } // Initialize dockPanel size dockPanel.setSize("" + Window.getClientWidth() + "px", "" + usableHeight + "px"); // The active panel must be the last on initalization because establishes coordenates leftBorderPanel.setSize(VERTICAL_BORDER_PANEL_WIDTH, usableHeight - (TopPanel.PANEL_HEIGHT + BottomPanel.PANEL_HEIGHT)); rightBorderPanel.setSize(VERTICAL_BORDER_PANEL_WIDTH, usableHeight - (TopPanel.PANEL_HEIGHT + BottomPanel.PANEL_HEIGHT)); centerWidth = Window.getClientWidth() - (2 * VERTICAL_BORDER_PANEL_WIDTH); centerHeight = usableHeight - (TopPanel.PANEL_HEIGHT + BottomPanel.PANEL_HEIGHT); topPanel.setWidth("" + Window.getClientWidth() + "px"); desktop.setSize(centerWidth, centerHeight); search.setSize(centerWidth, centerHeight); dashboard.setSize(centerWidth, centerHeight); administration.setSize(centerWidth, centerHeight); }
public void setCanvasSize(){ int width, height; width=(int)RootLayoutPanel.get().getOffsetWidth(); height=(int)RootLayoutPanel.get().getOffsetHeight(); height=height-MENUBARHEIGHT; width=width-VERTICALPANELWIDTH; if (cv != null) { cv.setWidth(width + "PX"); cv.setHeight(height + "PX"); cv.setCoordinateSpaceWidth(width); cv.setCoordinateSpaceHeight(height); } if (backcv != null) { backcv.setWidth(width + "PX"); backcv.setHeight(height + "PX"); backcv.setCoordinateSpaceWidth(width); backcv.setCoordinateSpaceHeight(height); } setCircuitArea(); }
public void setiFrameHeight() { if (iFrame==null) return; int i; int cumheight=0; for (i=0; i < verticalPanel.getWidgetIndex(iFrame); i++) { if (verticalPanel.getWidget(i) !=loadFileInput) { cumheight=cumheight+verticalPanel.getWidget(i).getOffsetHeight(); if (verticalPanel.getWidget(i).getStyleName().contains("topSpace")) cumheight+=12; } } int ih=RootLayoutPanel.get().getOffsetHeight()-MENUBARHEIGHT-cumheight; if (ih<0) ih=0; iFrame.setHeight(ih+"px"); }
public PlaygroundView(Playground controller) { this.controller = controller; this.sourceExamples = new MultiWordSuggestOracle(); this.policyExamples = new MultiWordSuggestOracle(); this.playgroundUI = new com.google.caja.demos.playground.client.ui.PlaygroundUI( sourceExamples, policyExamples); RootLayoutPanel.get().add(playgroundUI); initSourcePanel(); initPolicyPanel(); initFeedbackPanel(); initExamples(); initEditor(); initCaja(true); initPlusOne(); initUnsafe(); }
/** * Entry point for the application. */ @Override public void onModuleLoad() { projectService = GWT.create(ProjectRpc.class); userService = GWT.create(UserRpc.class); dataService = GWT.create(DataRpc.class); contentPanel = new LayoutPanel(); RootLayoutPanel.get().add(contentPanel); // Handle history changes. (Such as clicking a navigation hyperlink.) History.addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { String historyToken = event.getValue(); handleUrl(historyToken); } }); handleUrl(History.getToken()); }
@Override public void onModuleLoad() { Map<String, Integer> exampleIndexMap = new HashMap<>(); // choose your example TabLayoutPanel tabs = new TabLayoutPanel(27, Style.Unit.PX); int index = 0; for (OL3ExampleType example : OL3ExampleType.values()) { tabs.add(new LazyExampleWidget(example), example.name().replace("Example", "")); exampleIndexMap.put(example.name(), index); index++; } RootLayoutPanel.get().add(tabs); String token = History.getToken(); if (token != null && exampleIndexMap.containsKey(token)) { tabs.selectTab(exampleIndexMap.get(token)); } }
@Override public void onModuleLoad() { // Create a tab panel tabPanel = new TabLayoutPanel(2.5, Style.Unit.EM); tabPanel.setAnimationDuration(1000); tabPanel.getElement().getStyle().setMarginBottom(10.0, Style.Unit.PX); // Add event logger sample addTab(new EventLoggerSample()); // Add a tab gwt panels addTab(new PanelsSample()); tabPanel.selectTab(0); RootLayoutPanel.get().add(tabPanel); }
public void hide() { RootLayoutPanel.get().remove( this ); if( glass != null ) { RootLayoutPanel.get().remove( glass ); glass = null; } }
@Override public void onModuleLoad() { ensureCssInjected(); ManagerClientFactory clientFactory = new DefaultManagerClientFactoryImpl(); EventBus eventBus = clientFactory.getEventBus(); PlaceController placeController = clientFactory.getPlaceController(); // Start ActivityManager for the main widget with our ActivityMapper ActivityMapper activityMapper = new ManagerActivityMapper(clientFactory); ActivityManager activityManager = new ActivityManager(activityMapper, eventBus); activityManager.setDisplay(clientFactory.getLayoutView()); // Start PlaceHistoryHandler with our PlaceHistoryMapper ManagerPlaceHistoryMapper historyMapper= GWT.create(ManagerPlaceHistoryMapper.class); PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper); historyHandler.register(placeController, eventBus, defaultPlace); RootLayoutPanel.get().add(clientFactory.getLayoutView()); historyHandler.handleCurrentHistory(); }
public AppController(RootLayoutPanel widgetTag) { this.widgetTag = widgetTag; final UserId lastUserId = localStorage.getLastUserId(); if (lastUserId == null) { userResults = new UserResults(new UserData()); } else { userResults = new UserResults(localStorage.getStoredData(lastUserId)); } }
@Override public void onModuleLoad() { // Rest client configuration RestClient.setJacksonMarshallingActive(true); RestClient.setApplicationRoot("rs"); // Disable right click RootLayoutPanel.get().addDomHandler(new ContextMenuHandler() { @Override public void onContextMenu(ContextMenuEvent event) { event.preventDefault(); event.stopPropagation(); } }, ContextMenuEvent.getType()); // Create main content mainLayout = new MainLayout(); RootLayoutPanel.get().add(mainLayout); // init mainLayout.init(); }
/** * EMLStudio module load method */ @Override public void onModuleLoad() { HandlerManager eventBus = new HandlerManager(null); LoginController loginController = new LoginController(eventBus); AppController appViewer = new AppController(eventBus, loginController); appViewer.go(RootLayoutPanel.get()); }
public void onModuleLoad() { Viewport viewport = new Viewport(); ToolBrowser s = new ToolBrowser(); viewport.setWidget(s); RootLayoutPanel.get().add(viewport); }
private void layoutViews() { TermDetailsView termView = new TermDetailsView(eventBus, service); TermSynonymsView synonymsView = new TermSynonymsView(eventBus, service); RelatedTermsView relationshipsView = new RelatedTermsView(eventBus, service); SearchInputView searchInputView = new SearchInputView(eventBus, service); SearchOptionsView searchOptionsView = new SearchOptionsView(eventBus, service); SearchResultsView searchResultsView = new SearchResultsView(eventBus, service, searchOptionsView); SVGView svgView = new SVGView(eventBus, service); //CodeListView codelistView = new CodeListView(eventBus, service); DockLayoutPanel layoutPanel = new DockLayoutPanel(Unit.PX); HorizontalPanel southPanel = new HorizontalPanel(); southPanel.add(termView); southPanel.add(synonymsView); southPanel.add(relationshipsView); southPanel.setCellWidth(termView, "33.33%"); southPanel.setCellWidth(synonymsView, "33.33%"); southPanel.setCellWidth(relationshipsView, "33.33%"); southPanel.setWidth("100%"); FlowPanel eastPanel = new FlowPanel(); eastPanel.add(searchInputView); eastPanel.add(searchOptionsView); eastPanel.add(searchResultsView); layoutPanel.addNorth(menuBar, 30); layoutPanel.addSouth(southPanel, 197); layoutPanel.addEast(eastPanel, 300); layoutPanel.add(svgView); RootLayoutPanel.get().add(layoutPanel); }
@Override public void onLoad() { LayoutPanel layoutPanel = new LayoutPanel(); controller = new ReportingController(eventBus, rpcService); layoutPanel.add(controller.createView()); ReportingPresenter reportingPresenter = controller.getPresenter(); reportingPresenter.bind(); final RootPanel rootPanel = new RootPanel(layoutPanel, rpcService); rootPanel.getHeader().addTab("Batch Class Management", "BatchClassManagement.html", false); rootPanel.getHeader().addTab("Batch Instance Management", "BatchInstanceManagement.html", false); rootPanel.getHeader().addTab("Workflow Management", "CustomWorkflowManagement.html", false); rootPanel.getHeader().addTab("Folder Management", "FolderManager.html", false); rootPanel.getHeader().addNonClickableTab("Reports", "Reporting.html"); rootPanel.getHeader().getTabBar().selectTab(4); rootPanel.addStyleName("set_position"); rootPanel.getHeader().setEventBus(eventBus); rpcService.getUserName(new EphesoftAsyncCallback<String>() { @Override public void onSuccess(final String userName) { rootPanel.getHeader().setUserName(userName); } @Override public void customFailure(final Throwable arg0) { // Username cannot be set if the call failed. } }); RootLayoutPanel rootLayoutPanel = RootLayoutPanel.get(); rootLayoutPanel.clear(); rootLayoutPanel.add(rootPanel); }
@Inject public DownloadContainer() { frame = new Frame(); frame.getElement().setAttribute("name", TARGET); frame.setSize("0px", "0px"); frame.setVisible(false); frame.ensureDebugId(TARGET); RootLayoutPanel.get().add(frame); }
private void showRootPresenter() { SimpleLayoutPanel mainPanel = new SimpleLayoutPanel(); RootLayoutPanel.get().add(mainPanel); RootLayoutPanel.get().getElement().getStyle().setZIndex(0); workspacePresenterProvider.get().go(mainPanel); }
/** * Displays the {@link Window} popup. The popup will animate into view. * * @param selectAndFocusElement an {@link Focusable} to select and focus on when the panel is * shown. If null, no element will be given focus */ public void show(@Nullable final Focusable selectAndFocusElement) { setBlocked(false); if (isShowing) { setFocusOn( selectAndFocusElement); // the window is displayed but focus for the element may be lost return; } isShowing = true; // Attach the popup to the body. final JsElement popup = view.popup.getElement().cast(); if (popup.getParentElement() == null) { // Hide the popup so it can enter its initial state without flickering. popup.getStyle().setVisibility("hidden"); RootLayoutPanel.get().add(view); } // The popup may have been hidden before this timer executes. if (isShowing) { popup.getStyle().removeProperty("visibility"); // Start the animation after the element is attached. Scheduler.get() .scheduleDeferred( new ScheduledCommand() { @Override public void execute() { // The popup may have been hidden before this timer executes. view.setShowing(true); setFocusOn(selectAndFocusElement); } }); } }
@PostConstruct public void buildUI() { initWidget(uiBinder.createAndBindUi(this)); panel = RootLayoutPanel.get(); panel.add(this); initSubscribers(); }
@Override public void onModuleLoad() { Mvp4gModule module = GWT.create(Mvp4gModule.class); module.createAndStartModule(); RootLayoutPanel.get() .add((Widget) module.getStartView()); }
/** * This is the entry point method. */ public void onModuleLoad() { GWT.<GlobalResources>create(GlobalResources.class) .css() .ensureInjected(); Mvp4gModule module = (Mvp4gModule) GWT.create(Mvp4gModule.class); module.createAndStartModule(); RootLayoutPanel.get() .add((Widget) module.getStartView()); }
/** * This method constructs the application user interface by instantiating controls and hooking * up event handler. */ public void onModuleLoad() { // Inject global styles. GWT.<GlobalResources>create(GlobalResources.class) .css() .ensureInjected(); Mvp4gModule module = (Mvp4gModule) GWT.create(Mvp4gModule.class); module.createAndStartModule(); RootLayoutPanel.get() .add((Widget) module.getStartView()); }
@Override public void onModuleLoad() { Resources.CSS.employeeAdmin() .ensureInjected(); Mvp4gModule module = GWT.create(Mvp4gModule.class); module.createAndStartModule(); RootLayoutPanel.get() .add((Widget) module.getStartView()); }
public void onModuleLoad() { Canvas canvas = Canvas.createIfSupported(); canvas.setStyleName("MyCanvas"); canvas.setCoordinateSpaceWidth(400); canvas.setCoordinateSpaceHeight(400); RootLayoutPanel.get().add(canvas); gl = (WebGLRenderingContext)canvas.getContext("experimental-webgl"); gl.viewport(0, 0, 400, 400); WebGLBuffer vertexBuffer = gl.createBuffer(); gl.bindBuffer(ARRAY_BUFFER, vertexBuffer); gl.bufferData(ARRAY_BUFFER, Float32Array.create(VERTICES), STATIC_DRAW); WebGLShader vertexShader = gl.createShader(VERTEX_SHADER); gl.shaderSource(vertexShader, VERTEX_SHADER_SOURCE); gl.compileShader(vertexShader); WebGLShader fragmentShader = gl.createShader(FRAGMENT_SHADER); gl.shaderSource(fragmentShader, FRAGMENT_SHADER_SOURCE); gl.compileShader(fragmentShader); program = gl.createProgram(); gl.attachShader(program, vertexShader); gl.attachShader(program, fragmentShader); gl.linkProgram(program); gl.useProgram(program); gl.bindBuffer(ARRAY_BUFFER, vertexBuffer); WebGLUniformLocation texture = gl.getUniformLocation(program, "texture"); gl.uniform1i(texture, 0); int posAttr = gl.getAttribLocation(program, "position"); gl.vertexAttribPointer(posAttr, 3, FLOAT, false, 5*4, 0); gl.enableVertexAttribArray(posAttr); int texAttr = gl.getAttribLocation(program, "texcoord"); gl.vertexAttribPointer(texAttr, 2, FLOAT, false, 5*4, 3*4); gl.enableVertexAttribArray(texAttr); for(int i=0; i<TEXTURE_URLS.length; i++) { loadTexture(TEXTURE_URLS[i], i); } }
public ColourPickerPresenter(RootLayoutPanel widgetTag, UserResults userResults, int repeatCount) throws CanvasError { this.widgetTag = widgetTag; this.stimuliGroup = userResults.getPendingStimuliGroup(); userResults.setPendingStimuliGroup(null); this.stimuli = new ArrayList<>(stimuliGroup.getStimuli()); this.userResults = userResults; this.repeatCount = repeatCount; maxStimuli = this.stimuli.size(); colourPickerCanvasView = new ColourPickerCanvasView(); }
/** * This is the entry point method. */ @Override public void onModuleLoad() { final RootLayoutPanel widgetTag = RootLayoutPanel.get(); widgetTag.getElement().setId("widgetTag"); final AppController appController = new AppController(widgetTag); appController.start(); }
public void onModuleLoad() { Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { @Override public void execute() { Window.enableScrolling(false); shell = injector.getShell(); RootLayoutPanel.get().add(shell); } }); }
@Override public void onModuleLoad() { WorkPanelController ctrl = new WorkPanelController(); RootLayoutPanel.get().add(ctrl); IWorkPanel workPanel = DaggerApplication_WPShop.builder().wPModule(new WPModule()).build().panel(); ctrl.startWorkPanel(workPanel, new XWPExec() { @Override public void onResult(Object result) { Window.alert("Result ! : " + result); } @Override public void onError(Throwable throwable) { Window.alert("Error ! : " + throwable); } @Override public void onCancel() { Window.alert("Cancelled..."); } }, WPDisplayMode.DIALOG); }
@Override public void onModuleLoad() { CenterPanel centerPanel = new CenterPanel(); RootLayoutPanel.get().add( centerPanel ); // centerPanel.setWidget( new Form() ); DataBindingDemo dataBindingDemo = new DataBindingDemo(); dataBindingDemo.run( centerPanel ); }
@Override public void onResize() { int left = ResizablePanelBad.this.getAbsoluteLeft(); int top = ResizablePanelBad.this.getAbsoluteTop(); int width = ResizablePanelBad.this.getOffsetWidth(); int height = ResizablePanelBad.this.getOffsetHeight(); PositionAndSize posSize = new PositionAndSize( left, top, width, height ); boolean needAdjustment = posSize.limit(); if( needAdjustment ) { GWT.log( "onResize => re-resize !" ); RootLayoutPanel.get().setWidgetLeftWidth( ResizablePanelBad.this, posSize.left, Unit.PX, posSize.width, Unit.PX ); RootLayoutPanel.get().setWidgetTopHeight( ResizablePanelBad.this, posSize.top, Unit.PX, posSize.height, Unit.PX ); return; } for( Widget child : getChildren() ) { if( child instanceof RequiresResize ) { ((RequiresResize) child).onResize(); } } }
@Override public void show( boolean isAutoHide ) { this.isAutoHide = isAutoHide; if( isDisplayed ) return; isDisplayed = true; RootLayoutPanel.get().add( dock ); }
@Override public void hide() { if( ! isDisplayed ) return; isDisplayed = false; RootLayoutPanel.get().remove( dock ); CloseEvent.fire( this, null ); }
private void showApp() { Window.setMargin("0px"); RootLayoutPanel rootLayoutPanel = RootLayoutPanel.get(); rootLayoutPanel.clear(); appScreen.setWidth("100%"); rootLayoutPanel.add(appScreen); }
public GuessRoundPresenter(RootLayoutPanel widgetTag, UserResults userResults, final AudioPlayer audioPlayer) throws AudioException { super(widgetTag, userResults, audioPlayer, new GuessRoundView(audioPlayer)); guessRoundView = (GuessRoundView) abstractSvgView; languageDataProvider = new LanguageDataProvider(); int playerGamesPlayed = userResults.getUserData().getGamesPlayed(); userResults.getGameData().clearGameCounters(); playerLevel = new GameState().getPlayerLevel(playerGamesPlayed); roundDataProvider = new RoundDataProvider(); }
@Override public void onModuleLoad() { initRestyGwt(); mvp4gModule.createAndStartModule(); RootLayoutPanel.get().add((IsWidget) mvp4gModule.getStartView()); // See // http://www.summa-tech.com/blog/2012/06/11/7-tips-for-exception-handling-in-gwt/ handleUncaughtClientSideExceptions(mvp4gModule.getEventBus()); }
/** * This method constructs the application user interface by instantiating * controls and hooking up event handler. */ public void onModuleLoad() { // Inject global styles. GWT.<GlobalResources>create(GlobalResources.class).css().ensureInjected(); // Create the UI defined in Mail.ui.xml. DockLayoutPanel outer = binder.createAndBindUi(this); // Get rid of scrollbars, and clear out the window's built-in margin, // because we want to take advantage of the entire client area. Window.enableScrolling(false); Window.setMargin("0px"); // Special-case stuff to make topPanel overhang a bit. Element topElem = outer.getWidgetContainerElement(topPanel); topElem.getStyle().setZIndex(2); topElem.getStyle().setOverflow(Overflow.VISIBLE); // Listen for item selection, displaying the currently-selected item in // the detail area. mailList.setListener(new MailList.Listener() { public void onItemSelected(MailItem item) { mailDetail.setItem(item); } }); // Add the outer panel to the RootLayoutPanel, so that it will be // displayed. RootLayoutPanel root = RootLayoutPanel.get(); root.add(outer); }