List of usage examples for com.vaadin.ui Alignment BOTTOM_CENTER
Alignment BOTTOM_CENTER
To view the source code for com.vaadin.ui Alignment BOTTOM_CENTER.
Click Source Link
From source file:com.squadd.views.ChatView.java
private void buildLayout() { VerticalLayout chatAndFooter = new VerticalLayout(); chatAndFooter.setHeight("90%"); VerticalLayout contacts = new VerticalLayout(); contacts.setSizeFull();/* w w w . java 2s . c o m*/ contactsPanel.setHeight("800px"); contactsPanel.setWidth("300px"); contactsPanel.setContent(contactsLayout); contacts.addComponent(contactsPanel); contacts.setHeight("90%"); TextField idTo = new TextField("idTo"); idTo.setWidth("200px"); Button setIdTo = new Button("set"); setIdTo.setWidth("100px"); HorizontalLayout setUserToId = new HorizontalLayout(); Button.ClickListener st = new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { if (!idTo.getValue().equals("")) { UserInfoBean newUserTo = new UserInfoBean(); newUserTo.setId(Integer.parseInt(idTo.getValue())); newUserTo.setName("id" + idTo.getValue()); control.setUserTo(newUserTo); if (footer.isVisible() == false) { footer.setVisible(true); } UserInfoFace look = new UserInfoFace(newUserTo, control, footer); Panel panel = look.getUserPanel(); boolean exists = false; for (int i = 0; i < contactsLayout.getComponentCount(); i++) { if (contactsLayout.getComponent(i).getClass() == Panel.class) { Panel pan = (Panel) contactsLayout.getComponent(i); if ((!(pan.getId() == null)) && pan.getId().equals(idTo.getValue())) { exists = true; } } } if (exists == false) { contactsLayout.addComponent(panel); } control.clearChat(); control.updateChatLog(10); } idTo.clear(); } }; setIdTo.addClickListener(st); setUserToId.addComponents(idTo, setIdTo); setUserToId.setComponentAlignment(setIdTo, Alignment.BOTTOM_CENTER); contacts.addComponent(setUserToId); mainLayout.addComponents(contacts); footer.setVisible(false);///////// chatAndFooter.addComponents(chatPanel, footer); chatLayout = new VerticalLayout(); chatPanel.setHeight("750px"); chatPanel.setWidth("900px"); chatPanel.setContent(chatLayout); chatInput = new TextField(); chatInput.setWidthUndefined(); footer.addComponent(chatInput); chatInput.focus(); send.setWidth("120px"); footer.addComponent(send); clear.setWidth("120px"); footer.addComponent(clear); update.setWidth("120px"); footer.addComponent(update); footer.setHeight("50px"); footer.setWidth("900px"); chatInput.setWidth("100%"); footer.setExpandRatio(chatInput, 1f); chatAndFooter.setExpandRatio(chatPanel, 1f); mainLayout.addComponents(chatAndFooter); mainLayout.setExpandRatio(chatAndFooter, 1f); control.loadFriends(); }
From source file:com.vaadHL.window.base.BaseWindow.java
License:Apache License
/** * Creates the content of the window but does not set (display). The content * consists of three vertically placed areas: the upper, middle and bottom * area. Create content but don't bind data. * //from w w w.j a v a 2s . c o m * @return The just created content of the window. */ public Component getCompositeContent() { VerticalLayout content = new VerticalLayout(); Component c; c = makeUpperArea(); if (c != null) content.addComponent(c); c = makeMiddleArea(); if (c != null) { c.setSizeFull(); content.addComponent(c); content.setExpandRatio(c, 1); } c = makeBottomArea(); if (c != null) { VerticalLayout v = new VerticalLayout(); v.addComponent(c); v.setComponentAlignment(c, Alignment.BOTTOM_CENTER); /* * Label gap = new Label(); gap.setHeight("5px"); * v.addComponent(gap); */ content.addComponent(v); content.setComponentAlignment(v, Alignment.BOTTOM_CENTER); } content.setSpacing(true); return (content); }
From source file:com.wcs.wcslib.vaadin.widget.multifileupload.ui.ConfirmDialog.java
License:Apache License
private void initForm() { VerticalLayout windowLayout = new VerticalLayout(); setContent(windowLayout);//from w w w.ja va2s .c om windowLayout.setSizeUndefined(); windowLayout.setMargin(true); setCaption(confirmHeader); question = new Label(confirmQuestion); windowLayout.addComponent(question); HorizontalLayout buttonLayout = createButtonLayout(); windowLayout.addComponent(buttonLayout); windowLayout.setComponentAlignment(buttonLayout, Alignment.BOTTOM_CENTER); }
From source file:de.catma.ui.analyzer.AnalyzerView.java
License:Open Source License
private Component createSearchPanel() { HorizontalLayout searchPanel = new HorizontalLayout(); searchPanel.setSpacing(true);/*www . j a v a2s. co m*/ searchPanel.setWidth("100%"); searchInput = new TextField(); searchInput.setCaption("Query"); searchInput.setWidth("100%"); searchInput.setImmediate(true); searchPanel.addComponent(searchInput); searchPanel.setExpandRatio(searchInput, 1.0f); btExecSearch = new Button("Execute Query"); searchPanel.addComponent(btExecSearch); searchPanel.setComponentAlignment(btExecSearch, Alignment.BOTTOM_CENTER); return searchPanel; }
From source file:de.catma.ui.tagmanager.PropertyDefinitionDialog.java
License:Open Source License
private void initComponents(String caption) { setMargin(true);//from w ww . j av a2 s.c om setSpacing(true); GridLayout propPanel = new GridLayout(3, 3); propPanel.setSpacing(true); nameInput = new TextField("Name"); nameInput.setRequired(true); if (propertyDefinition != null) { nameInput.setValue(propertyDefinition.getName()); } propPanel.addComponent(nameInput, 0, 0, 2, 0); if (propertyDefinition != null) { valueInput = new ListSelect("Possible values", propertyDefinition.getPossibleValueList().getPropertyValueList().getValues()); } else { valueInput = new ListSelect("Possible values"); } valueInput.setWidth("100%"); valueInput.setRequired(true); valueInput.setNullSelectionAllowed(false); propPanel.addComponent(valueInput, 0, 1, 2, 1); newValueInput = new TextField("Add possible value"); propPanel.addComponent(newValueInput, 0, 2); btAdd = new Button("+"); propPanel.addComponent(btAdd, 1, 2); propPanel.setComponentAlignment(btAdd, Alignment.BOTTOM_CENTER); btRemove = new Button("-"); propPanel.addComponent(btRemove, 2, 2); propPanel.setComponentAlignment(btRemove, Alignment.BOTTOM_CENTER); addComponent(propPanel); HorizontalLayout buttonPanel = new HorizontalLayout(); buttonPanel.setSpacing(true); btSave = new Button("Save"); buttonPanel.addComponent(btSave); buttonPanel.setComponentAlignment(btSave, Alignment.MIDDLE_RIGHT); btCancel = new Button("Cancel"); buttonPanel.addComponent(btCancel); buttonPanel.setComponentAlignment(btCancel, Alignment.MIDDLE_RIGHT); addComponent(buttonPanel); setComponentAlignment(buttonPanel, Alignment.MIDDLE_RIGHT); window = new Window(caption); window.setContent(this); window.setWidth("30%"); window.setHeight("70%"); window.center(); }
From source file:de.symeda.sormas.ui.dashboard.surveillance.SurveillanceOverviewLayout.java
License:Open Source License
private void addShowMoreAndLessButtons() { HorizontalLayout buttonsLayout = new HorizontalLayout(); buttonsLayout.setHeightUndefined();//www . j av a2s . c om buttonsLayout.setWidth(100, Unit.PERCENTAGE); buttonsLayout.setMargin(new MarginInfo(false, true)); showMoreButton = new Button(I18nProperties.getCaption(Captions.dashboardShowAllDiseases), VaadinIcons.CHEVRON_DOWN); CssStyles.style(showMoreButton, ValoTheme.BUTTON_BORDERLESS, CssStyles.VSPACE_TOP_NONE, CssStyles.VSPACE_4); showLessButton = new Button(I18nProperties.getCaption(Captions.dashboardShowFirstDiseases), VaadinIcons.CHEVRON_UP); CssStyles.style(showLessButton, ValoTheme.BUTTON_BORDERLESS, CssStyles.VSPACE_TOP_NONE, CssStyles.VSPACE_4); hideOverview = new CheckBox(I18nProperties.getCaption(Captions.dashboardHideOverview)); CssStyles.style(hideOverview, CssStyles.VSPACE_3); showMoreButton.addClickListener(e -> { isShowingAllDiseases = true; refresh(); showMoreButton.setVisible(false); showLessButton.setVisible(true); }); showLessButton.addClickListener(e -> { isShowingAllDiseases = false; refresh(); showLessButton.setVisible(false); showMoreButton.setVisible(true); }); hideOverview.addValueChangeListener(e -> { if (hideOverview.getValue()) { diseaseBurdenView.setVisible(false); diseaseDifferenceComponent.setVisible(false); showLessButton.setVisible(false); showMoreButton.setVisible(false); } else { diseaseBurdenView.setVisible(true); diseaseDifferenceComponent.setVisible(true); showLessButton.setVisible(isShowingAllDiseases); showMoreButton.setVisible(!isShowingAllDiseases); } }); buttonsLayout.addComponent(showMoreButton); buttonsLayout.addComponent(showLessButton); buttonsLayout.setComponentAlignment(showMoreButton, Alignment.BOTTOM_CENTER); buttonsLayout.setExpandRatio(showMoreButton, 1); buttonsLayout.setComponentAlignment(showLessButton, Alignment.BOTTOM_CENTER); buttonsLayout.setExpandRatio(showLessButton, 1); buttonsLayout.addComponent(hideOverview); buttonsLayout.setComponentAlignment(hideOverview, Alignment.BOTTOM_RIGHT); buttonsLayout.setExpandRatio(hideOverview, 0); addComponent(buttonsLayout, EXTEND_BUTTONS_LOC); isShowingAllDiseases = false; showLessButton.setVisible(false); buttonsLayout.setExpandRatio(showLessButton, 1); }
From source file:dhbw.clippinggorilla.userinterface.views.ArchiveView.java
public ArchiveView() { HorizontalLayout optionsLayout = new HorizontalLayout(); optionsLayout.setWidth("100%"); Grid<Clipping> gridClippings = new Grid<>(); Set<Clipping> clippings = ClippingUtils.getUserClippings(UserUtils.getCurrent(), LocalDate.now(ZoneId.of("Europe/Berlin"))); gridClippings.setItems(clippings);/* w ww. ja va 2s .c o m*/ InlineDateTimeField datePicker = new InlineDateTimeField(); datePicker.setValue(LocalDateTime.now(ZoneId.of("Europe/Berlin"))); datePicker.setLocale(Locale.GERMANY); datePicker.setResolution(DateTimeResolution.DAY); datePicker.addValueChangeListener(date -> { Set<Clipping> clippingsOfDate = ClippingUtils.getUserClippings(UserUtils.getCurrent(), date.getValue().toLocalDate()); gridClippings.setItems(clippingsOfDate); gridClippings.getDataProvider().refreshAll(); }); DateTimeFormatter formatter = DateTimeFormatter.ofLocalizedTime(FormatStyle.MEDIUM); formatter.withZone(ZoneId.of("Europe/Berlin")); Column columnTime = gridClippings.addColumn(c -> { return c.getDate().format(formatter); }); Language.setCustom(Word.TIME, s -> columnTime.setCaption(s)); Column columnAmountArticles = gridClippings.addColumn(c -> { long amountArticles = c.getArticles().values().stream().flatMap(l -> l.stream()).count(); amountArticles += c.getArticlesFromGroup().values().stream().flatMap(l -> l.stream()).count(); if (amountArticles != 1) { return amountArticles + " " + Language.get(Word.ARTICLES); } else { return amountArticles + " " + Language.get(Word.ARTICLE); } }); Language.setCustom(Word.ARTICLES, s -> { columnAmountArticles.setCaption(s); gridClippings.getDataProvider().refreshAll(); }); gridClippings.setHeight("100%"); gridClippings.setSelectionMode(Grid.SelectionMode.SINGLE); gridClippings.addSelectionListener(c -> { if (c.getFirstSelectedItem().isPresent()) { currentClipping = c.getFirstSelectedItem().get(); showClippingBy(currentClipping, currentSort); } }); optionsLayout.addComponents(datePicker, gridClippings); optionsLayout.setComponentAlignment(datePicker, Alignment.BOTTOM_CENTER); optionsLayout.setComponentAlignment(gridClippings, Alignment.BOTTOM_RIGHT); optionsLayout.setExpandRatio(gridClippings, 5); VerticalLayout sortLayout = new VerticalLayout(); comboBoxSortOptions = new ComboBox<>(Language.get(Word.SORT_BY)); Language.setCustom(Word.SORT_BY, s -> { comboBoxSortOptions.setCaption(s); comboBoxSortOptions.getDataProvider().refreshAll(); }); comboBoxSortOptions.setItems(EnumSet.allOf(ClippingView.SortOptions.class)); comboBoxSortOptions.setItemCaptionGenerator(s -> s.getName()); comboBoxSortOptions.setItemIconGenerator(s -> s.getIcon()); comboBoxSortOptions.setValue(currentSort); comboBoxSortOptions.setTextInputAllowed(false); comboBoxSortOptions.setEmptySelectionAllowed(false); comboBoxSortOptions.addStyleName("comboboxsort"); comboBoxSortOptions.addValueChangeListener(e -> { currentSort = e.getValue(); showClippingBy(currentClipping, currentSort); }); comboBoxSortOptions.setVisible(false); sortLayout.setMargin(false); sortLayout.setSpacing(false); sortLayout.addComponent(comboBoxSortOptions); clippingArticlesLayout = new VerticalLayout(); clippingArticlesLayout.setSpacing(true); clippingArticlesLayout.setMargin(false); clippingArticlesLayout.setSizeFull(); addComponents(optionsLayout, sortLayout, clippingArticlesLayout); }
From source file:dhbw.clippinggorilla.userinterface.views.ClippingView.java
public ClippingView(Clipping clipping) { User user = UserUtils.getCurrent();/*from w w w.j a va 2s. c om*/ clippingArticlesLayout = new VerticalLayout(); clippingArticlesLayout.setSpacing(true); clippingArticlesLayout.setMargin(false); clippingArticlesLayout.setSizeFull(); HorizontalLayout clippingOptionsLayout = new HorizontalLayout(); clippingOptionsLayout.setSpacing(true); clippingOptionsLayout.setMargin(false); clippingOptionsLayout.setWidth("100%"); ComboBox<SortOptions> comboBoxSortOptions = new ComboBox<>(Language.get(Word.SORT_BY)); Language.setCustom(Word.SORT_BY, s -> { comboBoxSortOptions.setCaption(s); comboBoxSortOptions.getDataProvider().refreshAll(); }); comboBoxSortOptions.setItems(EnumSet.allOf(SortOptions.class)); comboBoxSortOptions.setItemCaptionGenerator(s -> s.getName()); comboBoxSortOptions.setItemIconGenerator(s -> s.getIcon()); comboBoxSortOptions.setValue(SortOptions.BYPROFILE); comboBoxSortOptions.setTextInputAllowed(false); comboBoxSortOptions.setEmptySelectionAllowed(false); comboBoxSortOptions.addStyleName("comboboxsort"); comboBoxSortOptions.addValueChangeListener(e -> { switch (e.getValue()) { case BYDATE: createClippingViewByDate(clipping); break; case BYPROFILE: createClippingViewByProfile(clipping); break; case BYSOURCE: createClippingViewBySource(clipping); break; } }); Button buttonRegenerateClipping = new Button(VaadinIcons.REFRESH); buttonRegenerateClipping.addStyleName(ValoTheme.BUTTON_PRIMARY); buttonRegenerateClipping.addClickListener(ce -> { user.setLastClipping(ClippingUtils.generateClipping(user, false)); ClippingGorillaUI.getCurrent().setMainContent(ClippingView.getCurrent()); }); clippingOptionsLayout.addComponents(comboBoxSortOptions, buttonRegenerateClipping); clippingOptionsLayout.setExpandRatio(comboBoxSortOptions, 5); clippingOptionsLayout.setComponentAlignment(buttonRegenerateClipping, Alignment.BOTTOM_CENTER); addComponents(clippingOptionsLayout, clippingArticlesLayout); createClippingViewByProfile(clipping); if (clipping.getArticles().keySet().isEmpty() && clipping.getArticlesFromGroup().keySet().isEmpty()) { Label labelNoProfile = new Label(); Language.setCustom(Word.NO_PROFILE_PRESENT, s -> labelNoProfile.setValue(s)); labelNoProfile.addStyleName(ValoTheme.LABEL_H2); clippingArticlesLayout.addComponent(labelNoProfile); } }
From source file:dhbw.ka.mwi.businesshorizon2.ui.initialscreen.InitialScreenViewImpl.java
License:Open Source License
public void setPageDescription(String source, String page, String[] description) { int labelCount = descriptionLayout.getComponentCount(); Label oldLabel;/*from ww w.j av a2s.co m*/ int i; homeIcon.setSource(new ThemeResource(source)); seitenLabel.setValue(page); for (i = 0; i < labelCount && i < description.length; i++) { oldLabel = (Label) descriptionLayout.getComponent(i); oldLabel.setValue(description[i]); if (i == 0) { descriptionLayout.setComponentAlignment(oldLabel, Alignment.BOTTOM_CENTER); } else { descriptionLayout.setComponentAlignment(oldLabel, Alignment.TOP_CENTER); } } // descriptionLabel.setValue(description[0]); for (int a = i; a < description.length; a++) { Label newLabel = new Label(description[a]); newLabel.setStyleName("descriptionLabel"); newLabel.setWidth(Sizeable.SIZE_UNDEFINED, 0); descriptionLayout.addComponent(newLabel); descriptionLayout.setComponentAlignment(newLabel, Alignment.TOP_CENTER); } for (int b = i; b < labelCount; b++) { descriptionLayout.removeComponent(descriptionLayout.getComponent(b)); } }
From source file:dhbw.ka.mwi.businesshorizon2.ui.login.LogInScreenViewImplv2.java
License:Open Source License
/** * Diese Methode setzt den Titel (im Browser-Fenster) zu * "Business Horizon 2" und erstellt die LogIn Maske mit Listener. Der * Listener prft ruft die im LogIn Event gesammelten LogIn-Daten und * bergibt sie dem presenter zur Kontrolle. Je nach ausgang der Konrolle * wird dann eine Fehlermeldung aufgerufen. Zudem wird mittels dem * "registrieren" Button und dessen Listener eine Dialogfenster * bereitgestellt mit dessen sich ein neuer Anwender registrieren kann. * /*from w ww . j a va 2 s. co m*/ * @author Christian Scherer */ private void generateUi() { setCaption("Business Horizon 3"); logger.debug("berschrift fr Browser erstellt"); horizontal = new HorizontalLayout(); vSplitPanel = new VerticalSplitPanel(); vSplitPanel.setSplitPosition(70, Sizeable.UNITS_PERCENTAGE); vSplitPanel.setLocked(true); verticalTop = new VerticalLayout(); verticalTop.setSizeFull(); verticalTop.setMargin(true, true, true, true); verticalTop.setStyleName("loginTop"); //Erzeugt ein Label mit dem Willkommens-Text neben dem Logo welcome = new Label("Willkommen bei"); welcome.setStyleName("welcomeSlogan"); //Erezeugt ein Label mit dem Beschreibungstext welcomeText = new Label( "Mithilfe dieser Software knnen Sie Ihre zuknftige Unternehmenswerte berechnen lassen. Hierzu stehen Ihnen verschiedene Methoden zur Verfgung, die Ihnen unterschiedliche Herangehensweisen ermglichen je nachdem, welche Daten Ihnen zur Verfgung stehen. "); welcomeText.setStyleName("welcomeText"); welcomeText.setSizeFull(); textLayout = new HorizontalLayout(); textLayout.setWidth(50, Sizeable.UNITS_PERCENTAGE); textLayout.addComponent(welcomeText); textLayout.setComponentAlignment(welcomeText, Alignment.TOP_RIGHT); iconLabel = new Label(); iconLabel.setIcon(new ThemeResource("images/Logo_businesshorizon.png")); iconLabel.setWidth(40, Sizeable.UNITS_PERCENTAGE); iconLabel.setStyleName("logo"); welcomeLayout = new HorizontalLayout(); welcomeLayout.setSizeFull(); welcomeLayout.addComponent(welcome); welcomeLayout.setComponentAlignment(welcome, Alignment.BOTTOM_CENTER); welcomeLayout.addComponent(iconLabel); welcomeLayout.setComponentAlignment(iconLabel, Alignment.BOTTOM_RIGHT); //Fgt den Beschreibungs-Text dem Bildschirm hinzu verticalTop.addComponent(textLayout); verticalTop.setComponentAlignment(textLayout, Alignment.TOP_RIGHT); verticalTop.addComponent(welcomeLayout); verticalTop.setComponentAlignment(welcomeLayout, Alignment.BOTTOM_RIGHT); login = new LoginForm(); //Zur Anmeldung muss die Mailadresse als Benutzername angegeben werden login.setUsernameCaption("Mailadresse"); login.setPasswordCaption("Passwort"); login.setWidth(null); login.setStyleName("login_form"); login.addListener(new LoginForm.LoginListener() { private static final long serialVersionUID = 1L; @Override public void onLogin(LoginEvent event) { presenter.doLogin(event.getLoginParameter("username"), event.getLoginParameter("password")); } }); //VerticalLayout login = generateLogin(); horizontal.addComponent(login); horizontal.setComponentAlignment(login, Alignment.TOP_CENTER); HorizontalLayout landingBtnLayout = new HorizontalLayout(); loginBtnLayout = new VerticalLayout(); loginBtn = new Button("", this); loginBtn.setWidth(100, Sizeable.UNITS_PIXELS); loginBtn.setHeight(100, Sizeable.UNITS_PIXELS); loginBtn.addStyleName("loginBtn"); loginBtnLabel = new Label("Login"); loginBtnLabel.setWidth(100, Sizeable.UNITS_PIXELS); loginBtnLabel.addStyleName("loginBtnLabel"); loginBtnLayout.addComponent(loginBtn); loginBtnLayout.addComponent(loginBtnLabel); // landingBtnLayout.addComponent(loginBtnLayout); //horizontal.addComponent(loginBtnLayout); //horizontal.setComponentAlignment(loginBtnLayout, Alignment.TOP_RIGHT); registerBtnLayout = new VerticalLayout(); registerBtnLayout.setSizeUndefined(); registerBtn = new Button("", this); registerBtn.setSizeUndefined(); registerBtn.setHeight(100, Sizeable.UNITS_PIXELS); registerBtn.setWidth(100, Sizeable.UNITS_PIXELS); registerBtn.addStyleName("registerBtn"); registerBtnLabel = new Label("Registrieren"); registerBtnLabel.setWidth(100, Sizeable.UNITS_PIXELS); addStyleName("registerBtnLabel"); registerBtnLayout.addComponent(registerBtn); registerBtnLayout.addComponent(registerBtnLabel); landingBtnLayout.addComponent(registerBtnLayout); passwordForgotBtn = new Button("Passwort vergessen", this); passwordForgotBtn.setEnabled(false); horizontal.addComponent(landingBtnLayout); horizontal.setComponentAlignment(landingBtnLayout, Alignment.TOP_RIGHT); horizontal.setMargin(new MarginInfo(true, true, true, true)); horizontal.setSizeFull(); //vertical.addComponent(passwordForgotBtn); //vertical.setComponentAlignment(passwordForgotBtn, Alignment.MIDDLE_CENTER); logger.debug("LogIn UI erstellt und Listener gesetzt"); vSplitPanel.setFirstComponent(verticalTop); vSplitPanel.setSecondComponent(horizontal); setContent(vSplitPanel); }