List of usage examples for com.google.gwt.user.client.ui DockLayoutPanel addSouth
public void addSouth(IsWidget widget, double size)
From source file:com.akjava.gwt.subplayer.client.SubPlayer.java
License:Apache License
@Override public void onModuleLoad() { //pre load resource ImageResource icon = Binder.INSTANCE.loadanime(); loadImg = new Image(icon); loadImg.setVisible(false);/* w w w . ja v a 2 s .c o m*/ loadImg.addLoadHandler(new LoadHandler() { @Override public void onLoad(LoadEvent event) { RootPanel.get().remove(loadImg); loadImg.setVisible(true); } }); RootPanel.get().add(loadImg); preference = new SubPlayerPreference(); preference.initialize(); tab = new TabLayoutPanel(2, Unit.EM); tab.setHeight("500px"); VerticalPanel root = new VerticalPanel(); root.setWidth("100%"); root.setHeight("100%"); //root.setHeight("200px"); DockLayoutPanel doc = new DockLayoutPanel(Unit.PX); doc.addSouth(new HTMLPanel( "<div align='center'>Subtitle TTS Player by <a href='http://www.akjava.com'>akjava.com</a></div>"), 40); doc.add(tab); RootLayoutPanel.get().add(doc); //RootLayoutPanel.get().add(new Label("hello")); tab.add(root, "PLAY"); noSubtitle = new Label("Subtitle is empty.load from Load tab"); noSubtitle.setStyleName("nosubtitle"); root.add(noSubtitle); loadPanel = new LoadPanel(); loadPanel.setWidth("100%"); loadPanel.setHeight("100%"); tab.add(loadPanel, "LOAD"); loadPanel.setText(preference.getSrtText()); itemPanel = new VerticalPanel(); itemPanel.setSpacing(8); itemPanelScroll = new ScrollPanel(itemPanel); itemPanelScroll.setWidth("100%"); itemPanelScroll.setHeight("350px"); root.add(itemPanelScroll); /* for(int i=0;i<5;i++){ String text=i+" hello world\n"; for(int j=0;j<i;j++){ text+="line\n"; } HTMLPanel label=new HTMLPanel(text.replace("\n", "<br/>")); FocusPanel panel=new FocusPanel(label); panel.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { unselectAll(); setlectWidget((Widget) event.getSource()); } }); //label.setHeight("100px"); itemPanel.add(panel); }*/ playerWidget = new PlayerWidget(this); root.add(playerWidget); DisclosurePanel ds = new DisclosurePanel("show subtitle time [start] - [end]"); timeLabel = new Label(); ds.add(timeLabel); //ds.add(new Label("0:0:0 - 0:0:12")); root.add(ds); selectWidgetHandler = new ClickHandler() { @Override public void onClick(ClickEvent event) { unselectAll(); setlectWidget((Widget) event.getSource()); } }; DisclosurePanel vs = new DisclosurePanel("Voice Settings"); root.add(vs); voiceSettings = new VoiceSettings(); vs.add(voiceSettings); //load data from preferences //if empty load mode. if (!loadPanel.getText().isEmpty()) { loadSrt(preference.getSrtSelectIndex()); } else { tab.selectTab(1); } }
From source file:com.calclab.emite.example.chat.client.ExampleIMChat.java
License:Open Source License
private void createUI() { final DockLayoutPanel dock = new DockLayoutPanel(Unit.PX); input = new TextBox(); dock.addSouth(input, 50); output = new VerticalPanel(); dock.add(output);// w ww .j a va 2 s. co m RootLayoutPanel.get().add(dock); }
From source file:com.google.gwt.examples.DockLayoutPanelExample.java
License:Apache License
public void onModuleLoad() { // Attach five widgets to a DockLayoutPanel, one in each direction. Lay // them out in 'em' units. DockLayoutPanel p = new DockLayoutPanel(Unit.EM); p.addNorth(new HTML("north"), 2); p.addSouth(new HTML("south"), 2); p.addEast(new HTML("east"), 2); p.addWest(new HTML("west"), 2); p.add(new HTML("center")); // Attach the LayoutPanel to the RootLayoutPanel. The latter will listen for // resize events on the window to ensure that its children are informed of // possible size changes. RootLayoutPanel rp = RootLayoutPanel.get(); rp.add(p);/*from w ww . j a va 2 s . co m*/ }
From source file:com.google.gwt.sample.stockwatcher.client.Panels.java
private Widget loadDockLayoutPanel() { DockLayoutPanel p = new DockLayoutPanel(Unit.EM); p.addNorth(new HTML("header"), 2); p.addSouth(new HTML("footer"), 2); p.addWest(new HTML("navigation"), 10); p.add(new HTML(MUSSUM_IPSUM_LITERIS)); p.setPixelSize(800, 500);/*from w ww . j ava 2s. com*/ return p; }
From source file:com.kludgenics.dcpu16.compiler.client.Compiler.java
License:Apache License
public void onModuleLoad() { RootLayoutPanel rootPanel = RootLayoutPanel.get(); DockLayoutPanel panel = new DockLayoutPanel(Unit.EM); codeArea = new TextArea(); codeArea.setText("int fib(int n) {\n" + " int cur = 1;\n" + " int prev = 1;\n" + " for (int i = 0; i < n; i++) {\n" + " int next = cur+prev;\n" + " prev = cur;\n" + " cur = next;\n" + " }\n" + " return cur;\n" + "}\n" + "\n" + "int main(void) {\n" + " return fib(5)+fib(6);\n" + "}\n"); DockLayoutPanel outputPanel = new DockLayoutPanel(Unit.EM); ListBox compiler = new ListBox(); compiler.addItem("Clang/LLVM"); outputPanel.addNorth(compiler, 2);//from w w w .ja v a2s . c om assemblyArea = new TextArea(); assemblyArea.setText("Asm"); Button compileButton = new Button(); compileButton.setText("Compile"); outputPanel.addSouth(compileButton, 2); outputPanel.add(assemblyArea); panel.addEast(outputPanel, 20); compilerOutput = new TextArea(); compilerOutput.setReadOnly(true); compilerOutput.setText("Compiler"); //panel.addWest(codeArea, 800); panel.addSouth(compilerOutput, 10); panel.add(codeArea); rootPanel.add(panel); compileButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { try { compilerOutput.setText("Compiling..."); assemblyArea.setText("Compiling..."); CompileService.compile(null, "test.c", codeArea.getText(), callback); } catch (RequestException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }); try { CompileService.compile(null, "test.c", codeArea.getText(), callback); } catch (RequestException e) { // TODO Auto-generated catch block e.printStackTrace(); } //panel.setSize("440", "300"); }
From source file:com.novartis.pcs.ontology.webapp.client.OntoBrowser.java
License:Apache License
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);/*from www.j av a2s .co m*/ 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); }
From source file:edu.caltech.ipac.firefly.ui.BaseDialog.java
public void setWidget(Widget w) { _theWidget = w;// ww w .ja v a 2 s .c om if (w instanceof RequiresResize) { DockLayoutPanel contents = new DockLayoutPanel(Style.Unit.PX); DockLayoutPanel layout = new DockLayoutPanel(Style.Unit.PX); _popup.setWidget(layout); VerticalPanel vp = new VerticalPanel(); vp.add(_buttons); vp.setWidth("100%"); layout.addSouth(vp, 50); layout.add(contents); contents.addStyleName("base-dialog"); contents.addStyleName("base-dialog-contents"); contents.add(w); } else { SimplePanel contents = new SimplePanel(); DockPanel layout = new DockPanel(); _popup.setWidget(layout); layout.add(_buttons, DockPanel.SOUTH); layout.add(contents, DockPanel.CENTER); contents.addStyleName("base-dialog"); contents.addStyleName("base-dialog-contents"); contents.setWidget(w); } }
From source file:edu.caltech.ipac.firefly.ui.searchui.CatddEnhancedPanel.java
public CatddEnhancedPanel(String ddSearchProcessor, String catalogName, final String cols, final String reqCols, final String cons, final String ddform, boolean defSelect) throws Exception { DockLayoutPanel mainPanel = new DockLayoutPanel(Style.Unit.PX); initWidget(mainPanel);//w w w. ja v a 2 s. co m FlowPanel topArea = new FlowPanel(); mainPanel.addSouth(topArea, 30); GwtUtil.setPadding(topArea, 5, 0, 0, 0); mainPanel.add(tableWrapper); mainPanel.setSize("100%", "100%"); GwtUtil.setPadding(tableWrapper, 0, 15, 0, 20); //CatalogRequest req = new CatalogRequest(CatalogRequest.RequestType.GATOR_DD); //req.setRequestId(ddSearchProcessor); //req.setQueryCatName(catalogName); TableServerRequest req = new TableServerRequest(ddSearchProcessor); req.setParam(CatalogRequest.CATALOG, catalogName); reqParams = req.getParams(); columns = cols; reqColumns = reqCols; reqColumnsList = StringUtils.asList(reqCols, ","); constraints = cons; if (!StringUtils.isEmpty(ddform)) formToSelect = ddform; _defSelect = defSelect; // GwtUtil.setStyle(mainPanel, "paddingLeft", "20px"); try { if (!formToSelect.equals("none")) { HorizontalPanel formType = new HorizontalPanel(); formType.add(new HTML("<b>Please select Long or Short Form display:<b> ")); formType.add(createListBox()); formType.add(new HTML("<br><br>")); topArea.add(formType); } buildPanel(formToSelect); } catch (Exception e) { throw new Exception(e.getMessage()); } Window.addResizeHandler(new ResizeHandler() { public void onResize(ResizeEvent event) { if (table != null && GwtUtil.isOnDisplay(table)) { table.onResize(); } } }); }
From source file:fr.squat51.geoportail.samples.client.DockLayoutMap.java
License:Apache License
public void onMapLoad() { final LatLng center = new LatLng(45.192, 5.72); final MapWidget mapGeoportal = new MapWidget(center, 13); DockLayoutPanel panel = new DockLayoutPanel(Unit.EM); panel.addNorth(new Label("header"), 3); panel.addSouth(new Label("footer"), 1); panel.addWest(new Label("menu"), 10); panel.addEast(new HTML(), 1); panel.add(mapGeoportal);//from w w w. ja v a 2 s . c o m RootLayoutPanel.get().add(panel); }
From source file:org.apache.openjpa.trader.client.OpenTrader.java
License:Apache License
/** * Builds up the widgets once the login is complete i.e. the server has supplied * the initialization data.// w ww .j av a 2 s.co m * */ void init(Trader trader, String uri, List<Stock> stocks) { this.trader = trader; _serviceURI = uri; Window.setTitle(trader.getName()); int W = Window.getClientWidth(); int H = 900;//Window.getClientHeight(); int headerHeight = 05 * H / 100; int westWidth = 25 * W / 100; int westHeight = 80 * H / 100; int centerWidth = 60 * W / 100; int centerHeight = 80 * H / 100; int footerHeight = 02 * H / 100; Unit unit = Unit.PX; stockPanel = new MarketDataPanel(this, westWidth - 10, 40 * westHeight / 100); int N = stocks.size(); for (int i = 0; i < N; i++) { stockPanel.insert(stocks.get(i)); } soldTradePanel = new TradeHistoryPanel(this, Ask.class, westWidth - 10, 20 * westHeight / 100); boughtTradePanel = new TradeHistoryPanel(this, Bid.class, westWidth - 10, 20 * westHeight / 100); serverPanel = new ServerLogPanel(this, centerWidth, 40 * centerHeight / 100); tradePanel = new TradingWindow(this, centerWidth, 40 * centerHeight / 100); orderPanel = new TradeOrderWindow(this, centerWidth, 10 * centerHeight / 100); FlowPanel west = new FlowPanel(); west.setSize((westWidth - 10) + "px", westHeight + "px"); west.add(decorate(stockPanel)); west.add(new HTML("<p>")); west.add(decorate(soldTradePanel)); west.add(new HTML("<p>")); west.add(decorate(boughtTradePanel)); FlowPanel center = new FlowPanel(); center.setSize(centerWidth + "px", centerHeight + "px"); center.add(decorate(orderPanel)); center.add(new HTML("<p>")); center.add(decorate(tradePanel)); center.add(new HTML("<p>")); center.add(decorate(serverPanel)); DockLayoutPanel main = new DockLayoutPanel(unit); main.addNorth(createHeader(), headerHeight); main.addSouth(createFooter(), footerHeight); main.addWest(west, westWidth); main.add(center); RootLayoutPanel.get().add(main); main.animate(500); setUpHelp(); stockPanel.startStockWatcher(); tradePanel.startTradableRefresher(); }