List of usage examples for com.vaadin.ui Alignment TOP_CENTER
Alignment TOP_CENTER
To view the source code for com.vaadin.ui Alignment TOP_CENTER.
Click Source Link
From source file:com.swifta.mats.web.usermanagement.UserDetailsModule.java
private HorizontalLayout getPC() { VerticalLayout cAgentInfo = new VerticalLayout(); final HorizontalLayout cPlaceholder = new HorizontalLayout(); cAgentInfo.setMargin(new MarginInfo(true, true, true, true)); cAgentInfo.setStyleName("c_details_test"); final VerticalLayout cLBody = new VerticalLayout(); cLBody.setStyleName("c_body_visible"); tb = new Table("Linked child accounts"); // addLinksTable(); final VerticalLayout cAllProf = new VerticalLayout(); HorizontalLayout cProfActions = new HorizontalLayout(); final FormLayout cProfName = new FormLayout(); cProfName.setStyleName("frm_profile_name"); cProfName.setSizeUndefined();//from w w w. ja v a 2s .c om final Label lbProf = new Label(); final TextField tFProf = new TextField(); lbProf.setCaption("Profile Name: "); lbProf.setValue("Certified Authorized User."); tFProf.setCaption(lbProf.getCaption()); cProfName.addComponent(lbProf); final Button btnEdit = new Button(); btnEdit.setIcon(FontAwesome.EDIT); btnEdit.setStyleName("btn_link"); btnEdit.setDescription("Edit profile name"); final Button btnCancel = new Button(); btnCancel.setIcon(FontAwesome.UNDO); btnCancel.setStyleName("btn_link"); btnCancel.setDescription("Cancel Profile name editting."); Button btnAdd = new Button("+"); // btnAdd.setIcon(FontAwesome.EDIT); btnAdd.setStyleName("btn_link"); btnAdd.setDescription("Set new profile"); Button btnRemove = new Button("-"); // btnRemove.setIcon(FontAwesome.EDIT); btnRemove.setStyleName("btn_link"); btnRemove.setDescription("Remove current profile"); // cProf.addComponent(cProfName); cProfActions.addComponent(btnEdit); cProfActions.addComponent(btnCancel); cProfActions.addComponent(btnAdd); cProfActions.addComponent(btnRemove); btnCancel.setVisible(false); cAllProf.addComponent(cProfName); cAllProf.addComponent(cProfActions); cAllProf.setComponentAlignment(cProfActions, Alignment.TOP_CENTER); cLBody.addComponent(cAllProf); // cLBody.addComponent(tb); tb.setSelectable(true); cAgentInfo.addComponent(cLBody); btnLink = new Button("Add New Link"); btnLink.setIcon(FontAwesome.LINK); btnLink.setDescription("Link new account."); // cLBody.addComponent(btnLink); // cLBody.setComponentAlignment(btnLink, Alignment.TOP_LEFT); btnLink.addClickListener(new LinkClickHandler()); cPlaceholder.setVisible(false); addLinkUserContainer(); cPlaceholder.setWidth("100%"); cLBody.addComponent(cPlaceholder); cLBody.setComponentAlignment(cPlaceholder, Alignment.TOP_CENTER); HorizontalLayout c = new HorizontalLayout(); c.addComponent(cAgentInfo); btnEdit.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = -8427226211153164650L; @Override public void buttonClick(ClickEvent event) { if (btnEdit.getIcon().equals(FontAwesome.EDIT)) { tFProf.setValue(lbProf.getValue()); tFProf.selectAll(); cProfName.replaceComponent(lbProf, tFProf); btnEdit.setIcon(FontAwesome.SAVE); btnCancel.setVisible(true); return; } else if (btnEdit.getIcon().equals(FontAwesome.SAVE)) { lbProf.setValue(tFProf.getValue()); cProfName.replaceComponent(tFProf, lbProf); btnEdit.setIcon(FontAwesome.EDIT); btnCancel.setVisible(false); return; } lbProf.setValue(tFProf.getValue()); cProfName.replaceComponent(tFProf, lbProf); btnEdit.setIcon(FontAwesome.EDIT); btnCancel.setVisible(false); } }); btnCancel.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = -2870045546205986347L; @Override public void buttonClick(ClickEvent event) { cProfName.replaceComponent(tFProf, lbProf); btnEdit.setIcon(FontAwesome.EDIT); btnCancel.setVisible(false); } }); btnAdd.addClickListener(new AddProfileHandler(cAllProf, cPlaceholder)); btnRemove.addClickListener(new RemoveProfileHandler(pop)); return c; }
From source file:com.trender.user.AddEditStudyView.java
@Override public void enter(ViewChangeListener.ViewChangeEvent event) { mainLayout = new VerticalLayout(); mainLayout.setSizeFull();/*from w w w . ja v a 2 s .c o m*/ wizard = new Wizard(); // wizard.setUriFragmentEnabled(true); wizard.addStep(new IntroStepWizardStudy(), "intro"); wizard.addStep(new SetupStepWizardStudy(questionService), "setup"); wizard.addStep(new ListenStepWizardStudy(), "listen"); wizard.addStep(new LastStepWizardStudy(wizard), "last"); wizard.setWidth(90, Unit.PERCENTAGE); wizard.setHeight(95, Unit.PERCENTAGE); wizard.getBackButton().setCaption("?"); wizard.getCancelButton().setCaption(""); wizard.getNextButton().setCaption(""); wizard.getFinishButton().setCaption(""); wizard.addListener(this); Component head = new Header().intitUserPageComponent("? 1"); mainLayout.addComponent(head); mainLayout.setExpandRatio(head, 15); mainLayout.addComponent(wizard); mainLayout.setComponentAlignment(wizard, Alignment.TOP_CENTER); mainLayout.setExpandRatio(wizard, 85); setCompositionRoot(mainLayout); setSizeFull(); }
From source file:com.trender.user.ProfilePageView.java
@Override public void enter(ViewChangeListener.ViewChangeEvent event) { verticalLayout = new VerticalLayout(); Component header = new Header().intitUserPageComponent("? 1"); verticalLayout.addComponent(header); verticalLayout.setComponentAlignment(header, Alignment.TOP_LEFT); verticalLayout.setExpandRatio(header, 12); Component form = new UserForm().ProfilForm(); verticalLayout.addComponent(form);// w w w. jav a 2 s .c o m verticalLayout.setComponentAlignment(form, Alignment.TOP_CENTER); verticalLayout.setExpandRatio(form, 88); verticalLayout.setSizeFull(); setCompositionRoot(verticalLayout); setSizeFull(); }
From source file:com.trivago.mail.pigeon.web.components.wizard.setup.SetupWizardComponent.java
License:Apache License
public SetupWizardComponent() { wizard = new Wizard(); wizard.addStep(new WizardGreetingPageComponent(), "start"); wizard.addStep(new WizardAddSenderComponent(), "sender"); wizard.addStep(new WizardAddRecipientGroupComponent(), "recipientgroup"); wizard.addStep(new WizardFinishedComponent(), "done"); wizard.setUriFragmentEnabled(false); wizard.addListener(this); wizard.setHeight("600px"); wizard.setWidth("800px"); VerticalLayout vl = new VerticalLayout(); vl.setSizeFull();// ww w . jav a 2 s . c o m vl.setMargin(true); vl.addComponent(wizard); vl.setComponentAlignment(wizard, Alignment.TOP_CENTER); setCompositionRoot(vl); }
From source file:com.vaushell.treetasker.application.window.UserWindow.java
License:Open Source License
/** * Displays the user's view./* w w w . j av a 2 s . co m*/ */ public void setUserView() { mainLayout.removeComponent(controller.getLoginLayout()); mainLayout.addComponent(controller.getActionBar()); HorizontalSplitPanel splitPanel = new HorizontalSplitPanel(); splitPanel.setWidth("1000px"); splitPanel.setHeight("100%"); splitPanel.setSplitPosition(30); splitPanel.setLocked(true); splitPanel.setMargin(true); splitPanel.setStyleName("content"); splitPanel.addComponent(controller.getTree()); splitPanel.addComponent(controller.getContent()); controller.refresh(); mainLayout.addComponent(splitPanel); mainLayout.setExpandRatio(splitPanel, 1); mainLayout.setComponentAlignment(splitPanel, Alignment.TOP_CENTER); }
From source file:com.wintindustries.pfserver.interfaces.view.dashboard.LoadingView.java
public LoadingView() { setSizeFull();/* ww w .ja va 2 s .com*/ VerticalLayout center = new VerticalLayout(); this.addComponent(center); this.setComponentAlignment(center, Alignment.MIDDLE_CENTER); center.setHeight("180px"); HorizontalLayout info = new HorizontalLayout(); Label title = new Label("PFServer Dashboard"); title.setSizeUndefined(); title.addStyleName(ValoTheme.LABEL_H4); title.addStyleName(ValoTheme.LABEL_COLORED); // center.addComponent(title); // center.setComponentAlignment(title, Alignment.BOTTOM_CENTER); Label loading = new Label("Initalizing"); loading.addStyleName(ValoTheme.LABEL_H1); loading.addStyleName(ValoTheme.LABEL_LIGHT); info.addComponent(loading); info.addComponent(title); info.setComponentAlignment(title, Alignment.MIDDLE_RIGHT); center.addComponent(info); info.setComponentAlignment(loading, Alignment.MIDDLE_LEFT); loading.setWidth("160px"); center.setComponentAlignment(info, Alignment.MIDDLE_CENTER); // center.addComponent(loading); // center.setComponentAlignment(loading, Alignment.TOP_CENTER); ProgressBar indeterminate = new ProgressBar(); indeterminate.setIndeterminate(true); center.addComponent(indeterminate); center.setComponentAlignment(indeterminate, Alignment.TOP_CENTER); }
From source file:de.catma.ui.visualizer.chart.DistributionChartView.java
License:Open Source License
private void initComponents(DistributionComputation distributionComputation) { setSpacing(true);// ww w . j av a 2s . c o m setMargin(new MarginInfo(true, false, false, false)); addStyleName("distributionchartviewpanel"); zoom = new Slider("Zoom", 0, 100, "%"); zoom.setValue(100.0); addComponent(zoom); setComponentAlignment(zoom, Alignment.TOP_CENTER); zoomPanel = new ZoomableVerticalLayout(); zoomPanel.setSizeFull(); List<Distribution> distributions = distributionComputation.getDistributions(); int rows = distributions.size() / ROW_LENGTH; if (distributions.size() % ROW_LENGTH != 0) { rows++; } Integer firstRowLength = null; for (int rowIdx = 0; rowIdx < rows; rowIdx++) { HorizontalLayout row = new HorizontalLayout(); row.setSpacing(true); zoomPanel.addComponent(row); row.setWidth("100%"); int rowLength = Math.min(distributions.size() - ((rowIdx) * ROW_LENGTH), ROW_LENGTH); if (firstRowLength == null) { firstRowLength = rowLength; } for (int colIdx = 0; colIdx < rowLength; colIdx++) { Distribution distribution = distributions.get((rowIdx * ROW_LENGTH) + colIdx); Chart chart = new Chart(distribution, maxOccurrences, distributionSelectionListener); int width = (int) (500.0 * (3.0 / firstRowLength)); chart.setWidth(width + "px"); chart.setHeight("700px"); row.addComponent(chart); charts.put(distribution.getId(), chart); } } addComponent(zoomPanel); }
From source file:de.fzi.fhemapi.view.vaadin.ui.DeviceDetailsPanel.java
License:Apache License
@AutoGenerated private VerticalLayout buildMainLayout() { // common part: create layout VerticalLayout layout = new VerticalLayout(); layout.setImmediate(false);/* ww w . jav a 2 s. c o m*/ layout.setWidth("100.0%"); layout.setHeight("-1"); layout.setMargin(false); HorizontalLayout titleLayout = new HorizontalLayout(); titleLayout.setImmediate(false); titleLayout.setWidth("-1"); titleLayout.setHeight("50"); titleLayout.setMargin(false); layout.addComponent(titleLayout); layout.setComponentAlignment(titleLayout, Alignment.TOP_CENTER); // deviceTitle deviceTitle = new TextField(); deviceTitle.setImmediate(true); deviceTitle.setWidth("100%"); deviceTitle.setHeight("-1px"); deviceTitle.setValue(device.getName()); deviceTitle.addListener(new Property.ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { if (((String) event.getProperty().getValue()).length() > 1) { device.rename((String) event.getProperty().getValue()); parent.reloadTree(); } } }); titleLayout.addComponent(deviceTitle); titleLayout.setComponentAlignment(deviceTitle, Alignment.TOP_CENTER); ComboBox combobox = new ComboBox(); String[] classes = DeviceFactory.getAvailableDevicetypes(); for (String name : classes) { combobox.addItem(name); } combobox.select(device.getClass().getSimpleName()); combobox.addListener(new Property.ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { setDeviceType((String) event.getProperty().getValue()); } }); combobox.setImmediate(true); deviceTypeHoriLayout = UIHelper.buildAttributePanel("Device Type", combobox); layout.addComponent(deviceTypeHoriLayout); layout.setComponentAlignment(deviceTypeHoriLayout, Alignment.TOP_CENTER); layout.setExpandRatio(deviceTypeHoriLayout, 1); ioDevHoriLayout = buildAttributePanel("IO Device", device.getType()); layout.addComponent(ioDevHoriLayout); layout.setComponentAlignment(ioDevHoriLayout, Alignment.TOP_CENTER); layout.setExpandRatio(ioDevHoriLayout, 1); addDeviceDetails(DevicePanelManager.getDeviceDetails(device, this), layout); return layout; }
From source file:de.fzi.fhemapi.view.vaadin.ui.DeviceDetailsPanel.java
License:Apache License
private void addDeviceDetails(List<DeviceDetailEntry> entries, VerticalLayout mainLayout) { for (DeviceDetailEntry entry : entries) { HorizontalLayout layout = UIHelper.buildAttributePanel(entry.caption, entry.component); mainLayout.addComponent(layout); mainLayout.setComponentAlignment(layout, Alignment.TOP_CENTER); mainLayout.setExpandRatio(layout, 1); }/*from ww w . j a v a2 s. c om*/ }
From source file:de.fzi.fhemapi.view.vaadin.ui.HWindow.java
License:Apache License
private void openConfig() { VerticalLayout layout = new VerticalLayout(); final TextArea area = new TextArea(null, server.getConfigManager().getConfigFile()); // area.setHeight("100%"); area.setRows(100);/* w w w . j av a2 s .c o m*/ area.setWidth("100%"); layout.addComponent(area); Button saveButton = new Button("Speichern"); saveButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { server.setFHEMCfg(((String) area.getValue())); getWindow().showNotification(server.rereadConfiguration().toString(), Notification.TYPE_TRAY_NOTIFICATION); server.getConfigManager().update(); } }); layout.addComponent(saveButton); layout.setComponentAlignment(saveButton, Alignment.TOP_CENTER); mainSplitPanel.setSecondComponent(layout); }