List of usage examples for com.google.gwt.user.client.ui SplitLayoutPanel SplitLayoutPanel
public SplitLayoutPanel()
From source file:org.primaresearch.web.layouteditor.client.WebLayoutEditor.java
License:Apache License
/** * This is the entry point method.//from w w w . j av a 2 s. c o m */ public void onModuleLoad() { try { //Set the number formatter (had to be decoupled since GWT doesn't work with DecimalFormat) DoubleValue.setFormatter(new GwtDecimalFormatter(DoubleValue.defaultFormatPattern)); resizeRequiredExtraHeight = Integer.parseInt(CONSTANTS.HeaderHeight()); //Listen for page content object selection changes selectionManager.addListener(this); //Initialisations imageLoader = new DocumentImageLoader(); pageLayout = new PageLayoutC(); pageSync = new PageSyncManager(null, pageLayout); pageView = new PageScrollView(pageLayout, imageLoader, selectionManager, true, false); pageContentRendererPlugin = new PageContentRendererPlugin(); pageView.getRenderer().addPlugin(pageContentRendererPlugin); pageContentRendererPlugin.setFill(false); pageView.getRenderer().addPlugin(selectionRendererPlugin = new ContentSelectionRendererPlugin()); pageView.addZoomListener(this); pageView.setMinZoom(0.05); pageSync.addListener(pageView); pageSync.addListener(this); imageLoader.addListener(pageView); imageLoader.addListener(this); //Main panel (child panels vertically arranged) mainPanel = new VerticalPanel(); mainPanel.setSize("99.8%", (Window.getClientHeight() - 1) + "px"); //Focus panel (required for keyboard handler) focusPanel = new FocusPanel(mainPanel); focusPanel.setSize("99.8%", (Window.getClientHeight() - 1) + "px"); focusPanel.addKeyPressHandler(this); focusPanel.addKeyDownHandler(this); focusPanel.getElement().getStyle().setOutlineWidth(0, Unit.PX); RootPanel.get().add(focusPanel); focusPanel.setFocus(true); //Header panel at the top FlexTable header = new FlexTable(); header.addStyleName("headerPanel"); mainPanel.add(header); documentTitle = new Label(CONSTANTS.LoadingDocument()); header.setWidget(0, 0, documentTitle); documentTitle.addStyleName("documentTitle"); //Centre panel (with toolbar, page view, and region labels) HorizontalPanel centerPanel = new HorizontalPanel(); mainPanel.add(centerPanel); centerPanel.setSize("99.8%", (Window.getClientHeight() - resizeRequiredExtraHeight) + "px"); //Toolbar panel at the left toolbar = createToolbar(); centerPanel.add(toolbar); centerPanel.setCellWidth(toolbar, "1%"); //Split panel with page view and region labels splitPanel = new SplitLayoutPanel(); centerPanel.add(splitPanel); splitPanel.setSize("99.8%", (Window.getClientHeight() - resizeRequiredExtraHeight) + "px"); splitPanel.addStyleName("contentPanel"); //Region labels VerticalPanel rightPanel = new VerticalPanel(); rightPanel.setWidth("100%"); splitPanel.addEast(rightPanel, Integer.parseInt(CONSTANTS.IntitialRegionLabelPanelWidth())); //Right // Headline regionTypeEditorHeading = new Label(CONSTANTS.LabelEditorHeadingCreateRegion()); regionTypeEditorHeading.addStyleName("regionTypeEditorHeading"); rightPanel.add(regionTypeEditorHeading); // Editor regionTypeEditor = new SimpleRegionTypeEditor(selectionManager); regionTypeEditor.addRegionTypeSelectionListener(this); selectionManager.addListener(regionTypeEditor); regionTypeEditor.getWidget().addStyleName("regionTypeEditor"); rightPanel.add(regionTypeEditor.getWidget()); //Page view splitPanel.add(pageView); //Centre pageView.asWidget().addStyleName("pageView"); //Text content dialogue createTextDialog(); //Resize handler (browser window resize events) Window.addResizeHandler(this); //Add tool icons to page view addToolIconsToPageView(); //Authenticate user userManager.addListener(this); userManager.logOn(Window.Location.getParameter("Appid"), Window.Location.getParameter("Did"), Window.Location.getParameter("Aid"), Window.Location.getParameter("a")); //Get the virtual keyboard layout from the server loadVirtualKeyboardLayout(); logManager.logInfo(0, "onModuleLoad() finished"); } catch (Exception exc) { logManager.logError(ERROR_ON_MODULE_LOAD, "Error in onModuleLoad()"); exc.printStackTrace(); } }
From source file:org.rstudio.studio.client.application.ui.RequestLogVisualization.java
License:Open Source License
public RequestLogVisualization() { overviewPanel_ = new LayoutPanel(); overviewPanel_.getElement().getStyle().setProperty("borderRight", "2px dashed #888"); scrollPanel_ = new ScrollPanelWithClick(overviewPanel_); scrollPanel_.setSize("100%", "100%"); scrollPanel_.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { detail_.setWidget(instructions_); }/*from ww w .ja v a 2 s . com*/ }); SplitLayoutPanel outerPanel = new SplitLayoutPanel(); outerPanel.getElement().getStyle().setBackgroundColor("white"); outerPanel.getElement().getStyle().setZIndex(500); outerPanel.getElement().getStyle().setOpacity(0.9); detail_ = new SimplePanel(); detail_.getElement().getStyle().setBackgroundColor("#FFE"); instructions_ = new HTML(); instructions_.setHTML("<p>Click on a request to see details. Click on the " + "background to show these instructions again.</p>" + "<h4>Available commands:</h4>" + "<ul>" + "<li>Esc: Close</li>" + "<li>P: Play/pause</li>" + "<li>E: Export</li>" + "<li>I: Import</li>" + "<li>+/-: Zoom in/out</li>" + "</ul>"); detail_.setWidget(instructions_); outerPanel.addSouth(detail_, 200); outerPanel.add(scrollPanel_); initWidget(outerPanel); handlerRegistration_ = Event.addNativePreviewHandler(this); timer_ = new Timer() { @Override public void run() { refresh(true, false); } }; refresh(true, true); }
From source file:org.simpledbm.samples.forum.client.SimpleForum.java
License:Open Source License
/** * This is the entry point method./*from www .j a va 2 s.com*/ */ public void onModuleLoad() { DockLayoutPanel outer = new DockLayoutPanel(Unit.EM); outer.addNorth(topPanel, 5); SplitLayoutPanel p = new SplitLayoutPanel(); p.addWest(forums, 192); p.addNorth(topics, 200); p.add(posts); outer.add(p); RootLayoutPanel root = RootLayoutPanel.get(); root.add(outer); requestProcessor.getForums(); }