List of usage examples for com.google.gwt.user.client.ui HasVerticalAlignment ALIGN_MIDDLE
VerticalAlignmentConstant ALIGN_MIDDLE
To view the source code for com.google.gwt.user.client.ui HasVerticalAlignment ALIGN_MIDDLE.
Click Source Link
From source file:com.google.gwt.sample.stockwatcher.client.Footer.java
@SuppressWarnings("unused") private void addLinkSeparator(HorizontalPanel _anchorPanel) { Label linkSeparator = new Label(); linkSeparator.setText("|"); linkSeparator.addStyleName("footer-link-separator"); _anchorPanel.add(linkSeparator);// ww w . j av a 2 s . c om _anchorPanel.setCellVerticalAlignment(linkSeparator, HasVerticalAlignment.ALIGN_MIDDLE); }
From source file:com.google.gwt.sample.stockwatcher.client.Header.java
public Header(String msg) { basePanel = new HorizontalPanel(); leftPanel = new HorizontalPanel(); rightPanel = new HorizontalPanel(); if (msg == null) { msg = Messages.WELCOME;//from w w w . j av a 2 s. com } leftPanel.clear(); leftPanel.setStyleName("header-panel"); leftPanel.add(new HTML(msg)); rightPanel.clear(); rightPanel.add(new HTML(Images.getImage(Images.BACKGROUND_LOAD, 30))); rightPanel.setVisible(false); basePanel.clear(); basePanel.add(leftPanel); basePanel.add(rightPanel); basePanel.setCellHorizontalAlignment(leftPanel, HasHorizontalAlignment.ALIGN_LEFT); basePanel.setCellHorizontalAlignment(rightPanel, HasHorizontalAlignment.ALIGN_RIGHT); basePanel.setCellVerticalAlignment(leftPanel, HasVerticalAlignment.ALIGN_MIDDLE); basePanel.setCellVerticalAlignment(rightPanel, HasVerticalAlignment.ALIGN_MIDDLE); initWidget(basePanel); }
From source file:com.google.gwt.sample.stockwatcher.client.Menu.java
public Menu() { // Set up menu items setupAnchors();//from www . j a v a2 s . c om // Render the main menu and its sub menus selectionPanel.clear(); selectionPanel.add(new HTML(verticalLine)); renderHomeAnchor(); renderMonitoringMenu("Monitoring/Reporting"); renderPlanningMenu("Control Module"); renderSettingsMenu("Device Setting"); renderOptionsMenu(Images.getImage(Images.GEAR_ICON, Menu.HEIGHT)); renderNotificationAnchor(); // Set up logo and title fsktmLogo.setHTML(Images.getImage(Images.FSKTM_LOGO, Menu.HEIGHT)); systemTitleLabel.setText(SYSTEM_TITLE); systemTitleLabel.addStyleName("gwt-MainMenuTitle"); HorizontalPanel leftMenuContainerPanel = new HorizontalPanel(); leftMenuContainerPanel.add(new HTML(Images.getImage(Images.LOADING_EPIC2, Menu.HEIGHT))); leftMenuContainerPanel.add(fsktmLogo); leftMenuContainerPanel.add(systemTitleLabel); leftMenuContainerPanel.add(selectionPanel); leftMenuContainerPanel.add(arrowAnchor); leftMenuContainerPanel.setCellVerticalAlignment(fsktmLogo, HasVerticalAlignment.ALIGN_MIDDLE); leftMenuContainerPanel.setCellVerticalAlignment(systemTitleLabel, HasVerticalAlignment.ALIGN_MIDDLE); leftMenuContainerPanel.setCellVerticalAlignment(selectionPanel, HasVerticalAlignment.ALIGN_MIDDLE); leftMenuContainerPanel.setCellVerticalAlignment(arrowAnchor, HasVerticalAlignment.ALIGN_MIDDLE); HorizontalPanel rightMenuContainerPanel = new HorizontalPanel(); rightMenuContainerPanel.add(cNotificationAnchor); rightMenuContainerPanel.add(sNotificationAnchor); rightMenuContainerPanel.add(aNotificationAnchor); rightMenuContainerPanel.add(optionsPanel); rightMenuContainerPanel.setWidth("100%"); rightMenuContainerPanel.setCellHorizontalAlignment(cNotificationAnchor, HasHorizontalAlignment.ALIGN_RIGHT); rightMenuContainerPanel.setCellHorizontalAlignment(sNotificationAnchor, HasHorizontalAlignment.ALIGN_RIGHT); rightMenuContainerPanel.setCellHorizontalAlignment(aNotificationAnchor, HasHorizontalAlignment.ALIGN_RIGHT); rightMenuContainerPanel.setCellHorizontalAlignment(optionsPanel, HasHorizontalAlignment.ALIGN_RIGHT); // Container Panel for Main Menu Panel HorizontalPanel menuContainerPanel = new HorizontalPanel(); menuContainerPanel.add(leftMenuContainerPanel); menuContainerPanel.add(rightMenuContainerPanel); menuContainerPanel.setCellVerticalAlignment(leftMenuContainerPanel, HasVerticalAlignment.ALIGN_MIDDLE); menuContainerPanel.setCellVerticalAlignment(rightMenuContainerPanel, HasVerticalAlignment.ALIGN_MIDDLE); menuContainerPanel.setCellHorizontalAlignment(rightMenuContainerPanel, HasHorizontalAlignment.ALIGN_RIGHT); menuContainerPanel.setWidth("100%"); // Set up main menu panel mainMenuPanel.clear(); mainMenuPanel.setWidth("100%"); mainMenuPanel.getElement().getStyle().setHeight(HEIGHT, Unit.PX); mainMenuPanel.addStyleName("gwt-MainMenuPanel"); mainMenuPanel.add(menuContainerPanel); mainMenuPanel.setCellVerticalAlignment(menuContainerPanel, HasVerticalAlignment.ALIGN_MIDDLE); mainMenuPanel.setCellHeight(menuContainerPanel, "100%"); initWidget(mainMenuPanel); }
From source file:com.google.gwt.sample.stockwatcher.client.Menu.java
private void renderHomeAnchor() { homeLogo.setHTML(Images.getImage(Images.HOME2, 25)); p.clear();/*www .j av a 2s . com*/ p.addStyleName("gwt-NewMainMenuPanel"); p.add(homeLogo); selectionPanel.add(p); selectionPanel.setCellVerticalAlignment(p, HasVerticalAlignment.ALIGN_MIDDLE); }
From source file:com.google.gwt.sample.stockwatcher.client.Menu.java
private void renderSettingsMenu(String _title) { //Add new vertical sections here VerticalMenu reportingMenu = new VerticalMenu(); reportingMenu.addMenu("Settings Menu"); reportingMenu.addAnchor(logicAnchor); reportingMenu.addAnchor(userNotificationAnchor); //Add content panel to popup panel settingsPopupMenu.add(reportingMenu.getMenus()); //Set main title and attach popup settingsModule = addNewModule(_title, settingsPopupMenu); selectionPanel.add(settingsModule);//from w w w . j av a 2 s. c om selectionPanel.setCellVerticalAlignment(settingsModule, HasVerticalAlignment.ALIGN_MIDDLE); }
From source file:com.google.gwt.sample.stockwatcher.client.Menu.java
private void renderMonitoringMenu(String _title) { //Add new vertical sections here VerticalMenu reportingMenu = new VerticalMenu(); reportingMenu.addMenu("Report Menu"); reportingMenu.addAnchor(liveAnchor); reportingMenu.addAnchor(historicalAnchor); //Add content panel to popup panel monitoringPopupMenu.add(reportingMenu.getMenus()); //Set main title and attach popup monitoringModule = addNewModule(_title, monitoringPopupMenu); selectionPanel.add(monitoringModule); selectionPanel.setCellVerticalAlignment(monitoringModule, HasVerticalAlignment.ALIGN_MIDDLE); }
From source file:com.google.gwt.sample.stockwatcher.client.Menu.java
private void renderPlanningMenu(String _title) { //Add new vertical sections here VerticalMenu planningMenu = new VerticalMenu(); planningMenu.addMenu("Function Menu"); planningMenu.addAnchor(actuatorAnchor); planningMenu.addAnchor(scheduleAnchor); //Add content panel to popup panel planningPopupMenu.add(planningMenu.getMenus()); //Set main title and attach popup planningModule = addNewModule(_title, planningPopupMenu); selectionPanel.add(planningModule);//from w ww. j a va 2 s. c o m selectionPanel.setCellVerticalAlignment(planningModule, HasVerticalAlignment.ALIGN_MIDDLE); }
From source file:com.google.gwt.sample.stockwatcher.client.Menu.java
public VerticalPanel addNewModule(String temp, PopupPanel popup) { Label label = new Label(temp); label.addStyleName("gwt-NewMainMenuHeader"); VerticalPanel mainPanel = new VerticalPanel(); mainPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); mainPanel.addStyleName("gwt-NewMainMenuPanel"); mainPanel.setHeight("30px"); mainPanel.add(label);/*w ww . j a va2s . c o m*/ mainPanel.addDomHandler(addShowPopupHandler(popup), ClickEvent.getType()); mainPanel.addDomHandler(addShowPopupMouseHandler(popup), MouseOverEvent.getType()); setPopupParam(popup, mainPanel); popupList.add(popup); return mainPanel; }
From source file:com.google.gwt.sample.stockwatcher.client.Menu.java
public VerticalPanel addNewModule(Anchor anchor, PopupPanel popup) { VerticalPanel mainPanel = new VerticalPanel(); mainPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); mainPanel.addStyleName("gwt-NewMainMenuPanel"); mainPanel.setHeight("30px"); mainPanel.add(anchor);/* w ww. j a v a2s .c o m*/ mainPanel.addDomHandler(addShowPopupHandler(popup), ClickEvent.getType()); mainPanel.addDomHandler(addShowPopupMouseHandler(popup), MouseOverEvent.getType()); setPopupParam(popup, mainPanel); popupList.add(popup); return mainPanel; }
From source file:com.google.gwt.sample.stockwatcher.client.MonitoringPage.java
public MonitoringPage() { Header.setHeaderTitle("Main Menu > Monitoring > Live Update Readings"); setHandlers();//from w w w . j av a 2 s . co m setWidgetContent(); VerticalPanel selectionPanel = new VerticalPanel(); selectionPanel.setStyleName("mainStyle"); selectionPanel.setSpacing(10); selectionPanel.add(new HTML("<h2>Selection Menu</h2></br>")); selectionPanel.add(new HTML("Please select site:")); selectionPanel.add(siteListBox); selectionPanel.add(new HTML("Please select controller:")); selectionPanel.add(siteControllerListBox); selectionPanel.add(new HTML("Please select sensor:")); selectionPanel.add(controllerSensorListBox); selectionPanel.add(goButton); parameterPanel.clear(); parameterPanel.add(selectionPanel); parameterPanel.setHeight("100%"); parameterPanel.setStyleName("parameterPanel"); chartPanel.clear(); chartPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); chartPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); contentPanel.clear(); contentPanel.addLeft(parameterPanel); contentPanel.add(chartPanel); // contentPanel.addRight(filterPanel); initWidget(contentPanel); }