List of usage examples for com.vaadin.ui HorizontalLayout setHeight
@Override public void setHeight(String height)
From source file:jp.primecloud.auto.ui.ServerDescBasic.java
License:Open Source License
public ServerDescBasic() { setHeight("100%"); addStyleName(Reindeer.PANEL_LIGHT);/*from w ww .j a va 2s .c om*/ VerticalLayout panel = (VerticalLayout) getContent(); panel.setWidth("100%"); panel.setHeight("100%"); panel.setMargin(true); panel.setSpacing(false); panel.addStyleName("server-desc-basic"); HorizontalLayout hlPanels = new HorizontalLayout(); hlPanels.setWidth("100%"); hlPanels.setHeight("100%"); hlPanels.setMargin(true); hlPanels.setSpacing(true); hlPanels.addStyleName("server-desc-basic"); // setContent(hlPanels); left.setWidth("100%"); right.setHeight("100%"); right.setWidth("100%"); //???? Label padding = new Label(" "); padding.setWidth("7px"); padding.setHeight("99%"); padding.addStyleName("desc-padding"); Label padding2 = new Label(""); padding2.setWidth("1px"); hlPanels.addComponent(left); hlPanels.addComponent(padding); hlPanels.addComponent(padding2); hlPanels.addComponent(right); hlPanels.setExpandRatio(left, 40); hlPanels.setExpandRatio(right, 60); panel.addComponent(hlPanels); panel.setExpandRatio(hlPanels, 1.0f); }
From source file:jp.primecloud.auto.ui.ServerDescDetail.java
License:Open Source License
public ServerDescDetail() { setHeight("100%"); addStyleName(Reindeer.PANEL_LIGHT);//from w w w. ja v a2s.c o m VerticalLayout panel = (VerticalLayout) getContent(); panel.setWidth("100%"); panel.setHeight("100%"); panel.setMargin(true); panel.setSpacing(false); panel.addStyleName("server-desc-detail"); HorizontalLayout hlPanels = new HorizontalLayout(); hlPanels.setWidth("100%"); hlPanels.setHeight("100%"); hlPanels.setMargin(true); hlPanels.setSpacing(true); hlPanels.addStyleName("server-desc-detail"); // setContent(hlPanels); left.setWidth("200px"); right.setWidth("100%"); right.setHeight("100%"); hlPanels.addComponent(left); hlPanels.addComponent(right); hlPanels.setExpandRatio(right, 100); panel.addComponent(hlPanels); panel.setExpandRatio(hlPanels, 1.0f); }
From source file:jp.primecloud.auto.ui.ServiceDescBasic.java
License:Open Source License
public ServiceDescBasic() { addStyleName(Reindeer.PANEL_LIGHT);//from ww w. j av a2 s . c o m setHeight("100%"); HorizontalLayout hlPanels = new HorizontalLayout(); hlPanels.setWidth("100%"); hlPanels.setHeight("100%"); hlPanels.setMargin(true); hlPanels.setSpacing(true); hlPanels.addStyleName("service-desc-basic"); setContent(hlPanels); left.setWidth("100%"); right.setWidth("100%"); //???? Label padding = new Label(" "); padding.setWidth("7px"); padding.setHeight("99%"); padding.addStyleName("desc-padding"); Label padding2 = new Label(""); padding2.setWidth("1px"); VerticalLayout layLeft = new VerticalLayout(); layLeft.setMargin(false); layLeft.setSpacing(false); layLeft.setWidth("100%"); layLeft.setHeight("100%"); layLeft.addComponent(left); layLeft.setExpandRatio(left, 1.0f); VerticalLayout layRight = new VerticalLayout(); layRight.setMargin(false); layRight.setSpacing(false); layRight.setWidth("100%"); layRight.setHeight("100%"); layRight.addComponent(right); layRight.addComponent(serverOpe); layRight.setExpandRatio(right, 1.0f); hlPanels.addComponent(layLeft); hlPanels.addComponent(padding); hlPanels.addComponent(padding2); hlPanels.addComponent(layRight); hlPanels.setExpandRatio(layLeft, 40); hlPanels.setExpandRatio(layRight, 60); }
From source file:jp.primecloud.auto.ui.ServiceDescDetail.java
License:Open Source License
public ServiceDescDetail() { addStyleName(Reindeer.PANEL_LIGHT);// w w w .j a va2 s . c o m setHeight("100%"); HorizontalLayout hlPanels = new HorizontalLayout(); hlPanels.setWidth("100%"); hlPanels.setHeight("100%"); hlPanels.setMargin(true); hlPanels.setSpacing(true); hlPanels.addStyleName("service-desc-detail"); setContent(hlPanels); left.setWidth("250px"); right.setWidth("100%"); right.setHeight("100%"); VerticalLayout layLeft = new VerticalLayout(); layLeft.setMargin(false); layLeft.setSpacing(false); layLeft.setWidth("250px"); layLeft.setHeight("100%"); layLeft.addComponent(left); layLeft.setExpandRatio(left, 1.0f); hlPanels.addComponent(layLeft); hlPanels.addComponent(right); hlPanels.setExpandRatio(right, 100); }
From source file:net.sf.gazpachoquest.questionnaires.views.login.OldLoginView.java
License:Open Source License
public OldLoginView() { setSizeFull();/*from w w w.jav a2 s .c o m*/ // Language bar in the top-right corner for selecting // invitation interface language final HorizontalLayout languageBar = new HorizontalLayout(); languageBar.setHeight("50px"); // addComponent(languageBar); // setComponentAlignment(languageBar, Alignment.TOP_RIGHT); // Allow selecting a language. We are in a constructor of a // CustomComponent, so preselecting the current // language of the application can not be done before // this (and the selection) component are attached to // the application. final ComboBox languageSelector = new ComboBox("Select a language") { @Override public void attach() { super.attach(); // setValue(getLocale()); } }; // for (int i=0; i<locales.length; i++) { String locale = "es"; languageSelector.addItem(locale); languageSelector.setItemCaption(locale, "espaol"); // Automatically select the current locale // if (locales[i].equals(getLocale())) languageSelector.setValue(locale); // } // Create the invitation input field invitationTextField = new TextField("Invitation key:"); invitationTextField.setWidth("300px"); invitationTextField.setRequired(true); invitationTextField.setInputPrompt("Your questionnair invitation key (eg. 12345678)"); invitationTextField.setInvalidAllowed(false); // Create login button enterButton = new Button("Enter", this); // Add both to a panel VerticalLayout fields = new VerticalLayout(languageSelector, invitationTextField, enterButton); fields.setCaption("Please enter your invitation key to access the questionnair"); fields.setSpacing(true); fields.setMargin(new MarginInfo(true, true, true, false)); fields.setSizeUndefined(); // The view root layout VerticalLayout viewLayout = new VerticalLayout(fields); viewLayout.setSizeFull(); viewLayout.setComponentAlignment(fields, Alignment.MIDDLE_CENTER); viewLayout.setStyleName(Reindeer.LAYOUT_BLUE); setCompositionRoot(viewLayout); }
From source file:nl.amc.biolab.nsg.display.component.MainUI.java
License:Open Source License
private HorizontalLayout buildTopPanelLeft() { HorizontalLayout topPanelLeft = new HorizontalLayout(); topPanelLeft.setImmediate(true);/* www . j a v a 2 s .c o m*/ topPanelLeft.setWidth("-1px"); topPanelLeft.setHeight("-1px"); topPanelLeft.setMargin(false); topPanelLeft.setSpacing(false); // updateCatButton = new NativeButton(); // updateCatButton.setCaption("synchronize data"); // updateCatButton.setVisible(false); // topPanelLeft.addComponent(updateCatButton); // topPanelLeft.setComponentAlignment(updateCatButton, new // Alignment(33)); projectsButton = new NativeButton(); projectsButton.setImmediate(true); projectsButton.setWidth("-1px"); projectsButton.setHeight("-1px"); projectsButton.setHtmlContentAllowed(true); elementsButton = new NativeButton(); elementsButton.setCaption("data"); elementsButton.setImmediate(true); elementsButton.setWidth("-1px"); elementsButton.setHeight("-1px"); elementsButton.setHtmlContentAllowed(true); processingsButton = new NativeButton(); processingsButton.setImmediate(true); processingsButton.setWidth("-1px"); processingsButton.setHeight("-1px"); processingsButton.setHtmlContentAllowed(true); return topPanelLeft; }
From source file:nl.amc.biolab.nsg.display.component.MainUI.java
License:Open Source License
private HorizontalLayout buildTopPanelMid() { // common part: create layout HorizontalLayout topPanelMid = new HorizontalLayout(); topPanelMid.setImmediate(false);//w w w . ja v a2 s. c o m topPanelMid.setWidth("-1px"); topPanelMid.setHeight("-1px"); topPanelMid.setMargin(false); topPanelMid.setSpacing(true); // searchLabel searchLabel = new Label(); searchLabel.setImmediate(false); searchLabel.setWidth("-1px"); searchLabel.setHeight("-1px"); searchLabel.setValue("search "); topPanelMid.addComponent(searchLabel); topPanelMid.setComponentAlignment(searchLabel, Alignment.MIDDLE_CENTER); // searchSelect searchSelect = new Select(); searchSelect.setImmediate(false); searchSelect.setWidth("-1px"); searchSelect.setHeight("-1px"); topPanelMid.addComponent(searchSelect); topPanelMid.setComponentAlignment(searchSelect, Alignment.MIDDLE_CENTER); // label_1 label_1 = new Label(); label_1.setImmediate(false); label_1.setWidth("-1px"); label_1.setHeight("-1px"); label_1.setValue(" with "); topPanelMid.addComponent(label_1); topPanelMid.setComponentAlignment(label_1, Alignment.MIDDLE_CENTER); // searchTextField searchTextField = new TextField(); searchTextField.setImmediate(false); searchTextField.setWidth("-1px"); searchTextField.setHeight("-1px"); topPanelMid.addComponent(searchTextField); topPanelMid.setComponentAlignment(searchTextField, Alignment.MIDDLE_CENTER); searchButton = new NativeButton(); searchButton.setCaption("refine search"); topPanelMid.addComponent(searchButton); topPanelMid.setComponentAlignment(searchButton, Alignment.MIDDLE_CENTER); allSearchButton = new NativeButton(); allSearchButton.setCaption("search in all columns"); topPanelMid.addComponent(allSearchButton); topPanelMid.setComponentAlignment(allSearchButton, Alignment.MIDDLE_CENTER); newSearchButton = new NativeButton(); newSearchButton.setCaption("new search"); topPanelMid.addComponent(newSearchButton); topPanelMid.setComponentAlignment(newSearchButton, Alignment.MIDDLE_CENTER); return topPanelMid; }
From source file:nl.amc.biolab.nsg.display.component.ProcessingForm.java
License:Open Source License
public void setButtons() { HorizontalLayout buttons = new HorizontalLayout(); buttons.setHeight("40px"); buttons.setSpacing(true);//ww w.jav a 2s .com getLayout().addComponent(buttons); final Button startButton = new NativeButton(); startButton.setCaption(SUBMIT); startButton.setImmediate(true); startButton.setWidth("-1px"); startButton.setHeight("-1px"); startButton.addListener(new Button.ClickListener() { private static final long serialVersionUID = 1906358615316029946L; public void buttonClick(ClickEvent event) { System.out.println(app.getValue()); Set<Long> inputDbIds = new HashSet<Long>(); for (Object iid : inputData.getItemIds()) { inputData.select(iid); inputDbIds.add(((DataElement) iid).getDbId()); } ((VaadinTestApplication) getApplication()).getUserDataService().setDataElementDbIds(inputDbIds); form.commit(); processing.setApplication((Application) app.getValue()); startButton.setData(processing); form.fireEvent(new Event(startButton)); } }); buttons.addComponent(startButton); buttons.setComponentAlignment(startButton, Alignment.TOP_RIGHT); final Button delButton = new NativeButton(); delButton.setCaption("remove inputs"); delButton.setImmediate(true); delButton.setWidth("-1px"); delButton.setHeight("-1px"); delButton.addListener(new Button.ClickListener() { private static final long serialVersionUID = -3377452914254101817L; @SuppressWarnings("unchecked") public void buttonClick(ClickEvent event) { if (inputData.getValue() != null) { for (DataElement de : (Set<DataElement>) inputData.getValue()) { inputData.removeItem(de); dataElements.remove(de); } } } }); buttons.addComponent(delButton); buttons.setComponentAlignment(delButton, Alignment.TOP_RIGHT); }
From source file:nl.amc.biolab.nsg.display.component.ViewerForm.java
License:Open Source License
private void addButtons(final List<Component> buttonList) { if (buttonList != null && buttonList.size() != 0) { HorizontalLayout buttons = new HorizontalLayout(); // buttons.setWidth("100%"); buttons.setHeight("50px"); buttons.setSpacing(true);//from w w w. j a va2 s . co m layout.addComponent(buttons); for (Component b : buttonList) { buttons.addComponent(b); buttons.setComponentAlignment(b, Alignment.TOP_LEFT); } getLayout().addComponent(buttons); } }
From source file:nl.amc.biolab.nsg.display.VaadinTestApplication.java
License:Open Source License
@Override public void init() { logger.setLevel(Level.DEBUG); setErrorHandler(new ErrorListener() { private static final long serialVersionUID = -7266040717402386801L; @Override/*w w w. j a v a2 s .co m*/ public void terminalError(com.vaadin.terminal.Terminal.ErrorEvent event) { if (event.getThrowable().getCause() instanceof InvalidValueException) { return; } logger.error("Error occured"); event.getThrowable().printStackTrace(); } }); app.setLogoutURL("/"); app.setTheme("nsg_theme"); setMainWindow(new Window("AMC nsg portlet")); getMainWindow().setWidth("100%"); getMainWindow().setHeight("300px"); // If no user is set do not load the application if (getUser() == null) { userDataService = null; return; } // If no userDataService is set yet, or the user is not logged in yet // Set the userDataService and check XNAT connectivity // Parses errors coming back and displays them in the application when necessary if (userDataService == null || userDataService.xnatLogin() == false) { try { setUserDataService(((User) getUser()).getScreenName(), ((User) getUser()).getUserId()); if (getPage() == DATA && this.getUserDataService() != null && this.getUserDataService().getUserId() == 0L && getUserDataService().getProjectDbId() == null) { this.getUserDataService().xnatLogin(); } } catch (RuntimeException e) { if (e == null || e.getMessage() == null || (!(e.getMessage().equals("No Password.") && !e.getMessage().equals("Wrong Password.") && !e.getMessage().equals("No User login.")))) { HorizontalLayout layout = new HorizontalLayout(); Label label = new Label("Server error. Please contact the administrator"); layout.setWidth("100%"); layout.setHeight("300px"); layout.removeAllComponents(); layout.addComponent(label); getMainWindow().removeAllComponents(); getMainWindow().addComponent(layout); return; } else if (e.getMessage().equals("No Password.") || e.getMessage().equals("Wrong Password.")) { getMainWindow().removeAllComponents(); getMainWindow().showNotification("Please enter your XNAT password"); } else if (e.getMessage().equals("No User login.")) { getMainWindow().showNotification("No User login."); HorizontalLayout layout = new HorizontalLayout(); Label label = new Label("Loading page."); layout.setWidth("100%"); layout.setHeight("300px"); layout.addComponent(label); label = new Label("Please contact the administrator for XNAT user setup"); layout.removeAllComponents(); layout.addComponent(label); getMainWindow().removeAllComponents(); getMainWindow().addComponent(layout); return; } } } processingService = new ProcessingService(userDataService); getMainWindow().removeAllComponents(); this.mainControl = new MainControl(this); // logger.debug("Finished creating the application and the components."); }